Created
June 13, 2012 20:48
-
-
Save fmorency/2926434 to your computer and use it in GitHub Desktop.
PySide v1.1.1 crash
This file contains 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
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
class Dummy(QObject): | |
def __init__(self, parent=None): | |
super(Dummy, self).__init__(parent) | |
@Slot() | |
def dummy_slot(self): | |
print 'In slot' | |
class MyTreeWidgetItem(QTreeWidgetItem, QObject): | |
signal = Signal() | |
def __init__(self, parent=None): | |
super(MyTreeWidgetItem, self).__init__(parent) | |
#Crash on the next line if 'class MyTreeWidgetItem(QObject, QTreeWidgetItem)' | |
self.setText(0, 'Test') | |
def emit(self): | |
self.signal.emit() | |
if __name__ == '__main__': | |
app = QApplication(sys.argv) | |
dummy = Dummy() | |
tree_widget = MyTreeWidgetItem() | |
#Crash on the next line if 'class MyTreeWidget(QTreeWidgetItem, QObject)' | |
tree_widget.signal.connect(dummy.dummy_slot) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment