On Fri, 21 Jun 2013 18:54:15 +0200, Detlev Offenbach <det...@die-offenbachs.de> wrote: > Hello, > > there was a strange observation reported using eric5. The eric5 PySvn > plug-in has a dialog to ask the user for a password. This is embedded in
> code like this > > cursor = QApplication.overrideCursor() > if cursor is not None: > QApplication.restoreOverrideCursor() > <call the login dialog, could take some time depending upon the user> > if cursor is not None: > QApplication.setOverrideCursor(cursor) > > Every now and than this code fails with > <class 'RuntimeError'>: > wrapped C/C++ object of type QCursor has been deleted > > What is wrong with my code? Probably... overrideCursor() returns a pointer to an internal copy of the cursor. This is deleted by restoreOverrideCursor(). Before calling restoreOverrideCursor() make a copy... cursor = QCursor(cursor) Phil _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt