Skip to content

Instantly share code, notes, and snippets.

@phihag
Created September 12, 2012 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phihag/3709893 to your computer and use it in GitHub Desktop.
Save phihag/3709893 to your computer and use it in GitHub Desktop.
from PySide import QtGui
from PySide.QtGui import QCheckBox,QGraphicsLayoutItem
import sys
class Editor(QGraphicsLayoutItem):
def __init__(self, name):
QGraphicsLayoutItem.__init__(self)
def update_value(self, value):
pass
class BooleanEditor(Editor, QCheckBox):
def __init__(self, value):
Editor.__init__(self, "foo")
QCheckBox.__init__(self)
self.update_value(value)
def update_value(self, value):
self.old_value = value
self.setCheckState(value) # Error occurs here. "value" will be boole
QtGui.QApplication(sys.argv)
BooleanEditor(True)
# Throws:
# ...
# File "pyside_typeerror.py", line 20, in update_value
# self.setCheckState(value) # Error occurs here. "value" will be boole
#TypeError: 'PySide.QtGui.QCheckBox.setCheckState' called with wrong argument types:
# PySide.QtGui.QCheckBox.setCheckState(bool)
#Supported signatures:
# PySide.QtGui.QCheckBox.setCheckState(PySide.QtCore.Qt.CheckState)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment