[Qt-jambi-interest] Error on connecting QCheckBox.toggled with QDialog.setVisible(boolean)
Eskil Abrahamsen Blomfeldt
eblomfel at trolltech.com
Fri Jul 4 08:45:59 CEST 2008
Curt Nowak wrote:
> I'm trying to toggle the visibility of a QDialog 'dialog' when a QCheckBox 'checkBox' is toggled.
> So I thought
>
> <code>
> checkBox.toggled.connect(dialog, "setVisible(boolean)");
> </code>
>
> would do the trick. But instead I get a com.trolltech.qt.QNoSuchSlotException.
> Misteriously
>
> <code>
> checkBox.toggled.connect(dialog, "setEnabled(boolean)");
> </code>
>
> works fine. What's up with that?
>
Hi, Curt.
This is a bug in the Qt Jambi generator. If the Generator sees a
function in a QObject subclass (such as QDialog) which is not set as a
slot in C++, and thus not intended to be a slot in the API, then it will
mark it with a @QtBlockedSlot annotation in Java. This means the method
will not be connectable and will not turn up in lists over available
slots in Designer etc. The bug your case has revealed is that when the
slot is virtual and is reimplemented in a subclass, then the Generator
will not realize that the new implementation is also considered a slot
in the original API.
QDialog reimplements setVisible() which causes this problem to occur in
your case.
Thanks for the report!
-- Eskil
More information about the Qt-jambi-interest
mailing list