[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] QCheckBox problem
From:       Doug Hackworth <doug.hackworth () vanderbilt ! edu>
Date:       2009-01-05 1:30:41
Message-ID: 496162C1.8090403 () vanderbilt ! edu
[Download RAW message or body]


Greetings.  This should be an easy one for someone to answer.

Simple situation:  I have a QCheckBox on a main window along with other widgets, 
but mysteriously it won't do anything.  Since all my other widgets (buttons, 
mainly) do what they're supposed to, I suspect I am using the QCheckBox 
incorrectly.  It's the first time I've tried using one.

I am attempting to connect the checkbox's "toggled()" signal to a slot with this 
line:

<code>
QtCore.QObject.connect(self.ui.checkMyCheckbox, QtCore.SIGNAL("toggled()"), 
self.MyCheckboxSlotFunction)
</code>

Here is the slot I have defined for it:

<code>
def CheckMultiMask(self):
         sys.stdout.write("checkbox toggleded\n")
         if (self.ui.checkMyCheckbox.isChecked()):
             sys.stdout.write("it's checked\n")
</code>

When the window loads, however, I can click on the QCheckBox all I want, to no 
avail.  Also, the application object doesn't complain when it loads, and I know 
it's getting to the connect() invocation quoted above...  I just don't know why 
the slot function doesn't seem to ever be invoked.  And again, my other widgets 
with signals/slots connected by me (in a manner like that above) are behaving as 
expected.

Any thoughts from the experts?  I'll be happy to provide further information on 
context if it's useful.

BTW, I'm using Ubuntu 7.10 and the following versions of PyQt / Qt:
$ pyuic4 --version
Python User Interface Compiler 4.3 for Qt version 4.3.2

(The MainWindow was constructed with Qt Designer by way of pyuic4.)

Thanks,
Doug

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic