Work around PySide setOverrideCursor bug in BusyCursor
This commit is contained in:
parent
7506ee3d3f
commit
8067ee25d5
@ -1,4 +1,4 @@
|
|||||||
from ..Qt import QtGui, QtCore
|
from ..Qt import QtGui, QtCore, QT_LIB
|
||||||
|
|
||||||
__all__ = ['BusyCursor']
|
__all__ = ['BusyCursor']
|
||||||
|
|
||||||
@ -17,6 +17,11 @@ class BusyCursor(object):
|
|||||||
app = QtCore.QCoreApplication.instance()
|
app = QtCore.QCoreApplication.instance()
|
||||||
isGuiThread = (app is not None) and (QtCore.QThread.currentThread() == app.thread())
|
isGuiThread = (app is not None) and (QtCore.QThread.currentThread() == app.thread())
|
||||||
if isGuiThread and QtGui.QApplication.instance() is not None:
|
if isGuiThread and QtGui.QApplication.instance() is not None:
|
||||||
|
if QT_LIB == 'PySide':
|
||||||
|
# pass CursorShape rather than QCursor for PySide
|
||||||
|
# see https://bugreports.qt.io/browse/PYSIDE-243
|
||||||
|
QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
|
||||||
|
else:
|
||||||
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
|
QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
|
||||||
BusyCursor.active.append(self)
|
BusyCursor.active.append(self)
|
||||||
self._active = True
|
self._active = True
|
||||||
@ -27,4 +32,3 @@ class BusyCursor(object):
|
|||||||
if self._active:
|
if self._active:
|
||||||
BusyCursor.active.pop(-1)
|
BusyCursor.active.pop(-1)
|
||||||
QtGui.QApplication.restoreOverrideCursor()
|
QtGui.QApplication.restoreOverrideCursor()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user