<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div>I just upgraded and I get problems patching at the instance level.</div><div><br></div><div>I used to patch my own 'customEvent' on the QApplication at the instance level. This doesn't work anymore.</div><div><br></div><div>Patching still works at the class level. The following code illustrates this:</div><div><br></div><div><br></div><div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">from PyQt4.QtCore import *</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">from PyQt4.QtGui import *</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">class App(QApplication):</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;def customEvent(self, event):</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;print 'inherited', event</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">if __name__ == '__main__':</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;def classPatch(self, event):</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;print 'classPatch', event</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;def instancePatch(event):</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;print 'instancePatch', event</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><font class="Apple-style-span" color="#0837FF">&nbsp;&nbsp; &nbsp;# This still works</font></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><font class="Apple-style-span" color="#0837FF">&nbsp;&nbsp; &nbsp;# App.customEvent = classPatch &nbsp;&nbsp;</font></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;app = App([])</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><font class="Apple-style-span" color="#FF2600">&nbsp;&nbsp; &nbsp;# This used to work but doesn't anymore.</font></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><font class="Apple-style-span" color="#FF2600">&nbsp;&nbsp; &nbsp;# app.customEvent = instancePatch&nbsp;</font></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;QApplication.sendEvent(app, QEvent(1000))</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;widget = QWidget()</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; ">&nbsp;&nbsp; &nbsp;widget.show()</span></font></div><div><font class="Apple-style-span" face="'Courier New'" size="4"><span class="Apple-style-span" style="font-size: 14px; "><br></span></font></div></div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 14px; ">&nbsp;&nbsp; &nbsp;app.exec_()</span></div><div><br></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 14px; "></span>On Sep 26, 2009, at 11:13 AM, Phil Thompson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>PyQt v4.6 and SIP v4.9 have been released and are available from the usual<br>places.<br><br>This more or less completes the development identified in the (now<br>discarded) roadmap. In particular it means that QString and QVariant can be<br>made to disappear completely. This is the default if you are using Python<br>v3. Python v2 retains the old behaviour (for obvious compatibility reasons)<br>but you can select the new behaviour using the new sip.setapi() call. All<br>the examples will still run under Python v2 and v3.<br><br>See the respective NEWS files for the details.<br><br>Phil<br>_______________________________________________<br>PyQt mailing list &nbsp;&nbsp;&nbsp;<a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></div></blockquote></div><br></body></html>