Skip to content

@phihag /pyside_typeerror.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.