Hello,
I'm trying to disconnect widgets but I don't manage to do so. I probably don't use the right commands. I have tested a few of them, but there must be a mistake. Does anybody see what I'm doing wrong here?
Here is an example of what happens (I made it short, initial version is much longer). The function I connect is here a simple message saying you're still connected. I have 2 loops, the first one supposed to connect, the second to disconnect. In my real script the second loop will be activated by a signal. But I don't manage to disconnect :(
edit : in details:
wMywidget[k].textChanged.disconnect( wMywidget[k], functionForThisWidget ) leads to an error, so you can remove this line if you test it.
The other disconnect(....) don't seemm to diconnect.
var n = 3;
wDial = new DzBasicDialog();
wBox = new DzVGroupBox(wDial);
var wMywidget = new Array;
for (k=0; k<n; k++)
{
wMywidget[k] = new Array;
wMywidget[k] = new DzLineEdit(wBox);
wMywidget[k].text = "my text"+k;
connect(wMywidget[k], "textChanged(const QString&)", functionForThisWidget);
}
for (k=0; k<n; k++)
{
disconnect(wMywidget[k], "textChanged(const QString&)", functionForThisWidget);
disconnect(wMywidget[k], "textChanged(const QString&)");
disconnect(wMywidget[k], "textChanged(const QString&)", 0, 0);
disconnect(wMywidget[k], "textChanged()", functionForThisWidget);
disconnect(wMywidget[k], "textChanged()");
disconnect(wMywidget[k]);
wMywidget[k].textChanged.disconnect( wMywidget[k], functionForThisWidget ) // you can remove this lines it leads to an error
}
function functionForThisWidget()
{ print("Still connected") }
wDial.addWidget (wBox);
wDial.exec()