eric6/E5Gui/E5OverrideCursor.py

changeset 8118
0ecebcd8875e
parent 7923
91e843545d9a
child 8143
2c730d5fd177
diff -r aaa5e0eacd4e -r 0ecebcd8875e eric6/E5Gui/E5OverrideCursor.py
--- a/eric6/E5Gui/E5OverrideCursor.py	Sat Feb 20 11:52:49 2021 +0100
+++ b/eric6/E5Gui/E5OverrideCursor.py	Sat Feb 20 14:22:30 2021 +0100
@@ -67,7 +67,7 @@
         """
         Constructor
         """
-        self.__cursor = None
+        self.__cursorShape = None
     
     def __enter__(self):
         """
@@ -76,8 +76,9 @@
         @return reference to the context manager object
         @rtype E5OverrideCursor
         """
-        self.__cursor = QGuiApplication.overrideCursor()
-        if self.__cursor is not None:
+        cursor = QGuiApplication.overrideCursor()
+        if cursor is not None:
+            self.__cursorShape = cursor.shape()
             QGuiApplication.restoreOverrideCursor()
             QGuiApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
         
@@ -94,8 +95,8 @@
         @return always returns None to not suppress any exception
         @rtype None
         """
-        if self.__cursor is not None:
-            QGuiApplication.setOverrideCursor(self.__cursor)
+        if self.__cursorShape is not None:
+            QGuiApplication.setOverrideCursor(QCursor(self.__cursorShape))
             QGuiApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
         
         return None     # __IGNORE_WARNING_M831__

eric ide

mercurial