My program have a set of checkbox, When user check a checkbox, i should call slot1() and user uncheck checkbox, i should call slot2(),But i can't understand when user checks and when unchecked.

My questions is, How can i find out user check and unchecked checkbox? It's very important that i differ between check and unckeck.

Notes: i didn't find any signal related to uncked.

有帮助吗?

解决方案

There are signals clicked(bool) and toggled(bool):

If the button is checkable, checked is true if the button is checked, or false if the button is unchecked.

http://pyqt.sourceforge.net/Docs/PyQt4/qabstractbutton.html#clicked http://pyqt.sourceforge.net/Docs/PyQt4/qabstractbutton.html#toggled

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top