add pattern factory/singletton to create different type of element

add two news class for element type : simple and folio report
add an empty tab for the element report in the element properties widget


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2665 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-12-20 20:30:55 +00:00
parent fa91cead3f
commit 7ff6ac4410
18 changed files with 326 additions and 30 deletions

View File

@@ -14,19 +14,7 @@ elementpropertieswidget::elementpropertieswidget(Element *elmt, QWidget *parent)
element_ (elmt),
diagram_ (elmt->diagram())
{
setWindowTitle(tr("Propri\351t\351s de l'\351l\351ment"));
tab_ = new QTabWidget(this);
tab_ -> addTab(generalWidget(), tr("G\351n\351ral"));
dbb = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::Reset,
Qt::Horizontal, this);
connect(dbb, SIGNAL(clicked(QAbstractButton*)), this, SLOT(standardButtonClicked(QAbstractButton*)));
QVBoxLayout *main_layout = new QVBoxLayout(this);
main_layout -> addWidget(tab_);
main_layout -> addWidget(dbb);
setLayout(main_layout);
buildInterface();
}
/**
@@ -89,6 +77,45 @@ QWidget* elementpropertieswidget::generalWidget() {
return general_widget;
}
/**
* @brief elementpropertieswidget::buildInterface
*build the interface of this dialog, the main tab can have
*different tab according to the edited element
*/
void elementpropertieswidget::buildInterface() {
setWindowTitle(tr("Propri\351t\351s de l'\351l\351ment"));
tab_ = new QTabWidget(this);
tab_ -> addTab(generalWidget(), tr("G\351n\351ral"));
//Add tab according to the element
switch (element_ -> linkType()) {
case Element::simple:
break;
case Element::report:
w = new QComboBox(this);
tab_ -> addTab(w, tr("Report de folio"));
break;
case Element::master:
break;
case Element::slave:
break;
case Element::bornier:
break;
default:
break;
}
dbb = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::Reset,
Qt::Horizontal, this);
connect(dbb, SIGNAL(clicked(QAbstractButton*)), this, SLOT(standardButtonClicked(QAbstractButton*)));
QVBoxLayout *main_layout = new QVBoxLayout(this);
main_layout -> addWidget(tab_);
main_layout -> addWidget(dbb);
setLayout(main_layout);
}
/**
* @brief elementpropertieswidget::standardButtonClicked
* apply action when click in the dialog standard button box