Skip to content

Instantly share code, notes, and snippets.

@fmorency
Created June 13, 2012 20:48
Show Gist options
  • Save fmorency/2926434 to your computer and use it in GitHub Desktop.
Save fmorency/2926434 to your computer and use it in GitHub Desktop.
PySide v1.1.1 crash
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