Hello everybdy. I'm understand the real problem; this is my code
Every time the openLightDialog() is called, it seems the connect below is duplicated: the SLOT starts many time how I called openLightDialog(); eg if I call openLightDialog() 3 times, when a signal occurs, activeTabLight(int) is called 3 time instead one; I tried to put a disconnect at the end (but I don't like it). Furthermore, it seems that disconnect conficlits with a connect inside myLightDialog() constructor....
myLightDialog
::myLightDialog( QWidget* parent,
const char* name,
bool modal, WFlags fl
) :lightDialog (parent, name, modal, fl) {
connect (this->buttonGroupLL, SIGNAL(clicked(int)), this, SLOT(pushButtonLight(int))); // with disconnect at the end, this doesn't work!!
}
myLightDialog::myLightDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
:lightDialog (parent, name, modal, fl) {
connect (this->buttonGroupLL, SIGNAL(clicked(int)), this, SLOT(pushButtonLight(int))); // with disconnect at the end, this doesn't work!!
}
To copy to clipboard, switch view to plain text mode
void myMainForm::openLightDialog() {
vector <QCheckBox*> cbl;
cbl.push_back(lightd->checkBoxL0);
................................
for (int i=0; i<8; i++)
connect(cbl[i], SIGNAL(stateChanged(int)), this, SLOT(activeTabLight(int)));
if(lightd->exec()){
DoSomething();
......................
}
for (int i=0; i<8; i++) {
cbl[i]->disconnect();
}
void myMainForm::openLightDialog() {
vector <QCheckBox*> cbl;
cbl.push_back(lightd->checkBoxL0);
................................
for (int i=0; i<8; i++)
connect(cbl[i], SIGNAL(stateChanged(int)), this, SLOT(activeTabLight(int)));
if(lightd->exec()){
DoSomething();
......................
}
for (int i=0; i<8; i++) {
cbl[i]->disconnect();
}
To copy to clipboard, switch view to plain text mode
How to do this? maybe Do I have to destroy that vector anywhere?
thanks
Bookmarks