[PyQt] Getting a SystemError: error return without exception set
when I try to do QGraphicsScene.addItem(QGraphicsItem)
Phil Thompson
phil at riverbankcomputing.com
Fri Dec 11 21:52:09 GMT 2009
On Fri, 11 Dec 2009 10:15:19 -0800 (PST), dizou <di_zou at yahoo.com> wrote:
> I have a widget that creates two objects, DisplayScene and DisplayView.
> DisplayScene inherits from the QGraphicsScene class, and DisplayView
> inherits from the QGraphicsView class. I also have MyItem that inherits
> from
> the QGraphicsItem class. When I run this program and the
DisplayScene.Read
> method is called I create a MyItem object and I try to add it to the
> DisplayScene. When I do this I get this error:
> SystemError: error return without exception set
>
> Here is my code:
>
> class MainWidget(QWidget):
> def __init__(self):
> QWidget.__init__(self)
>
> self.display = DisplayScene(self)
> self.view = DisplayView(self.display)
> self.view.show()
> self.display.Read()
>
> class MyItem(QTreeWidgetItem, QGraphicsItem):
> def __init__(self, parent=None):
> QTreeWidgetItem.__init__(self, parent)
> QGraphicsItem.__init__(self)
You can't multiply inherit from two wrapped classes.
Phil
More information about the PyQt
mailing list