Hi everyone,
 
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?
Again, I attached a very small program to demonstrate what I mean. Of course, 
the workaround is easily done. I'm just curious.
Thanks for any hints,
 
Curt
 
 
import com.trolltech.qt.gui.QApplication;
import com.trolltech.qt.gui.QCheckBox;
import com.trolltech.qt.gui.QDialog;
import com.trolltech.qt.gui.QWidget;

public class ConnectSample
{
    public static void main(String[] args)
    {
        QApplication.initialize(args);
        QWidget dialog = new QDialog(null);
        QCheckBox checkBox = new QCheckBox();
        checkBox.toggled.connect(dialog, "setEnabled(boolean)");                
        checkBox.toggled.connect(dialog, "setVisible(boolean)");                
// Bang!
        dialog.show();
        QApplication.exec();
    }
}


_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to