1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
/* Le code qui permet d'appeler la modification du QFormLayout */
filterDefinitionWindow::filterDefinitionWindow(QWidget * parent) : QDialog(parent) {
QComboBox * m_filterType = new QComboBox();
layout->addWidget(m_filterType);
connect(m_filterType, SIGNAL(currentIndexChanged(int)), this, SLOT(constructLayout(int)));
}
void filterDefinitionWindow::constructLayout(const int index) {
if(m_container->layout()!=0)
delete(m_container->layout());
QFormLayout * form = new QFormLayout();
m_container->setLayout(form);
/* Ajoute les éléments dans le QFormLayout */
switch(index) {
case 0: form->addRow(QLabel....QLineEdit...); break;
case 1: from->addRow(QLabel....QLineEdit...); break;
.......
}
} |