[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Strange observation
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2013-06-21 21:12:42
Message-ID: c7441999831798f75f4692b2202aa66b () localhost
[Download RAW message or body]
On Fri, 21 Jun 2013 18:54:15 +0200, Detlev Offenbach
<detlev@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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic