Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
a7d2118a
Commit
a7d2118a
authored
Jun 18, 2012
by
Luke Campagnola
Browse files
Added very simple, enterable object for setting busy cursor during long operations
parent
f9310d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
widgets/BusyCursor.py
0 → 100644
View file @
a7d2118a
from
pyqtgraph.Qt
import
QtGui
,
QtCore
__all__
=
[
'BusyCursor'
]
class
BusyCursor
:
"""Class for displaying a busy mouse cursor during long operations.
Usage::
with pyqtgraph.BusyCursor():
doLongOperation()
May be nested.
"""
active
=
[]
def
__enter__
(
self
):
QtGui
.
QApplication
.
setOverrideCursor
(
QtGui
.
QCursor
(
QtCore
.
Qt
.
WaitCursor
))
BusyCursor
.
active
.
append
(
self
)
def
__exit__
(
self
,
*
args
):
BusyCursor
.
active
.
pop
(
-
1
)
if
len
(
BusyCursor
.
active
)
==
0
:
QtGui
.
QApplication
.
restoreOverrideCursor
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment