Feb-03-2017, 05:47 PM
(Jan-29-2017, 11:08 AM)California Wrote:
Error:Traceback (most recent call last): File "/home/pi/Desktop/Qt4/Project/01/Test_Class/apps_5.py", line 8, in print_situation self.checkBox = QtGui.QCheckBox(self) TypeError: arguments did not match any overloaded call: QCheckBox(QWidget parent=None): argument 1 has unexpected type 'bool' QCheckBox(QString, QWidget parent=None): argument 1 has unexpected type 'bool'# python 2.7.9 from PyQt4 import QtCore, QtGui import gui_5 def print_situation(self): self.checkBox = QtGui.QCheckBox(self) if self.checkBox.checkState() == QtCore.Qt.Checked: print "Checked" else: print "Unchecked"
Sounds like print_situation() is being called with different parameters than you expect it is. For example, what do you think "self" means here? Because whatever you think it is, it's apparently a True/False.
My suggestion would be to either 1) change the function to have *args and then print them out so you see what it's actually getting called with, or 2) look up the docs for what button.click.connect does.