Created
September 12, 2012 20:59
-
-
Save phihag/3709893 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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