martisho
10th November 2009, 10:24
Hi all,
i have a problem, with a loop I create several LineEdits and signals, depending of the content of a list that stores data from a XML.
The problem is that the user can modify the content of the different LineEdits, but i do not know how to recognize which LineEdit has been modified, because it was created by a loop.
void Controller_run::update_running_list(Q3ListViewItem *s){
QLabel *name = new QLabel;
QLineEdit *value = new QLineEdit;
connect (value, SIGNAL (editingFinished()),this, SLOT (Actualize()));
value->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt:: AlignVCenter);
value->setMinimumSize(QSize(71, 20));
value->setMaximumSize(QSize(71, 20));
name->setText(s->text(0));
value->setText(s->text(4));
if( s->text(1) == "DISCRETE_IN" || s->text(1) == "ANALOG_IN"){
value->setDisabled("true");
gridlayout->addWidget(name,row_input, 2);
gridlayout->addWidget(value, row_input, 3);
}
else{
value->setEnabled("true");
gridlayout->addWidget(name,row_output, 0);
gridlayout->addWidget(value, row_output, 1);
}
}
Please, any idea? Thank you!
i have a problem, with a loop I create several LineEdits and signals, depending of the content of a list that stores data from a XML.
The problem is that the user can modify the content of the different LineEdits, but i do not know how to recognize which LineEdit has been modified, because it was created by a loop.
void Controller_run::update_running_list(Q3ListViewItem *s){
QLabel *name = new QLabel;
QLineEdit *value = new QLineEdit;
connect (value, SIGNAL (editingFinished()),this, SLOT (Actualize()));
value->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt:: AlignVCenter);
value->setMinimumSize(QSize(71, 20));
value->setMaximumSize(QSize(71, 20));
name->setText(s->text(0));
value->setText(s->text(4));
if( s->text(1) == "DISCRETE_IN" || s->text(1) == "ANALOG_IN"){
value->setDisabled("true");
gridlayout->addWidget(name,row_input, 2);
gridlayout->addWidget(value, row_input, 3);
}
else{
value->setEnabled("true");
gridlayout->addWidget(name,row_output, 0);
gridlayout->addWidget(value, row_output, 1);
}
}
Please, any idea? Thank you!