[Qt-jambi-interest] Error on connecting QCheckBox.toggled with QDialog.setVisible(boolean)
Waldemar Wittmann
w_wittmann at gmx.de
Fri Jul 4 11:43:58 CEST 2008
Am Freitag, den 04.07.2008, 08:45 +0200 schrieb Eskil Abrahamsen
Blomfeldt:
> 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
Hi Eskil and all,
i think the same or a bit different problem is with QTreeView ->
setAnimated(boolean)
If I do (in the constructor) of an arbitrary Class with a reference
"view" on QTreeView: checkBox.toggled.connect(view,
"setAnimated(boolean)");
i get: Exception in thread "main" com.trolltech.qt.QNoSuchSlotException:
public final void com.trolltech.qt.gui.QTreeView.setAnimated(boolean)
I do simply:
checkBox.toggled.connect(this, "mySetAnimated(boolean)");
...
}
mySetAnimated(boolean b) {
view.setAnimated(b);
}
and it works ...
regards,
Waldemar
More information about the Qt-jambi-interest
mailing list