<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Thanks Brian, but I don't understand that. If it is derived from a non-object, how does the connect work?<br><br>I went with the reverse approach: <br>class ObjWrapper(QObject):<br> def __init__(self, item):<br> QObject.__init__(self)<br> self.item=item<br>... then provide the properties, signals/slots, which all operate on self.item ...<br><br>It would be handy if these approaches were discussed in the docs.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Brian Kelley
<kelley@eyesopen.com><br><b><span style="font-weight: bold;">To:</span></b> Jason H <scorp1us@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> "pyqt@riverbankcomputing.com" <pyqt@riverbankcomputing.com><br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, October 1, 2009 8:16:52 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [PyQt] GraphicsItem, QObject Inheritance problem<br></font><br>
<title>Re: [PyQt] GraphicsItem, QObject Inheritance problem</title>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">What you can do, however, is to make a QObject delegate like:<br>
<br>
class WrappedAffineItem(AffineItem):<br>
def __init__(self ...):<br>
self.qobject = QObject(self)<br>
AffineItem.__init__(self, ..., parent)<br>
self.qobject.connect(self.qobject, <br>
SIGNAL("mysignal(int)",<br>
SLOT(self.dosomething))<br>
<br>
def connect(self, *a, *kw):<br>
self.qobject.connect(*a,**kw)<br>
<br>
def soSomething(self, *a):<br>
pass<br>
<br>
Brian Kelley</span></font>
</div></div></div><br>
</body></html>