Refactor some properties dialog.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4027 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-06-23 20:40:05 +00:00
parent 55e013f3e0
commit 3c21364d5e
13 changed files with 112 additions and 317 deletions

View File

@@ -22,10 +22,11 @@
#include "elementtextitem.h"
#include "diagramcommands.h"
#include <QtDebug>
#include <elementpropertiesdialog.h>
#include "elementprovider.h"
#include "diagramposition.h"
#include "terminal.h"
#include "PropertiesEditor/propertieseditordialog.h"
#include "elementpropertieswidget.h"
/**
Constructeur pour un element sans scene ni parent
@@ -48,14 +49,15 @@ Element::Element(QGraphicsItem *parent) :
Element::~Element() {
}
void Element::editProperty() {
if (diagram())
if(!diagram()->isReadOnly()){
ElementPropertiesDialog epw (this, diagram()->views().first());
connect(&epw, SIGNAL(editElementRequired(ElementsLocation)), diagram(), SIGNAL(editElementRequired(ElementsLocation)));
connect(&epw, SIGNAL(findElementRequired(ElementsLocation)), diagram(), SIGNAL(findElementRequired(ElementsLocation)));
epw.exec();
}
void Element::editProperty()
{
if (diagram() && !diagram()->isReadOnly())
{
ElementPropertiesWidget *epw = new ElementPropertiesWidget(this);
PropertiesEditorDialog dialog(epw, QApplication::activeWindow());
connect(epw, &ElementPropertiesWidget::findEditClicked, &dialog, &QDialog::reject);
dialog.exec();
}
}