-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move busy cursor function to new py file
- Loading branch information
1 parent
d89871d
commit 39653ff
Showing
2 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from qgis.PyQt.QtCore import QCoreApplication, Qt | ||
from qgis.PyQt.QtWidgets import QApplication | ||
|
||
|
||
def show_busy_cursor(func): | ||
def wrapper(*args, **kwargs): | ||
QApplication.setOverrideCursor(Qt.WaitCursor) | ||
QCoreApplication.processEvents() | ||
|
||
try: | ||
return func(*args, **kwargs) | ||
finally: | ||
QApplication.restoreOverrideCursor() | ||
QCoreApplication.processEvents() | ||
|
||
return wrapper |