[Qt-jambi-interest] signal.connect() creates double connections in some cases
Mathias
listo.mathias at googlemail.com
Thu Feb 5 16:38:17 CET 2009
Gentlemen,
consider this:
public class MyTabWidget extends QTabWidget {
public MyTabWidget() {
currentChanged.connect(this, "currentTabChanged(int)");
}
private void currentTabChanged(int index) {
System.out.println("Changed!");
}
}
This short piece of code works as expected. On every tab change one line of
console printout.
However, if you rename the slot method to the same name as the signal
("currentChanged" in this case) the connect() call creates two connections
to the slot:
public class MyTabWidget extends QTabWidget {
public MyTabWidget() {
currentChanged.connect(this, "currentChanged(int)");
}
private void currentChanged(int index) {
System.out.println("Changed!");
}
}
This creates two lines of printout on every tab change.
Unexpected to me... :)
Cheers from the Black Forest,
Mathias
PS: I'm sorry if this thing is already in some bug tracking database. I
haven't seen one for Jambi yet, maybe I haven't looked hard enough?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20090205/46ba83db/attachment.html
More information about the Qt-jambi-interest
mailing list