def waitCursor(): """Context manager creating an hour glass style cursor for longer-running blocking tasks inside GUI code. Example:: with waitCursor(): # process takes some time pass """ try: QApplication.setOverrideCursor(Qt.WaitCursor) yield finally: QApplication.restoreOverrideCursor()
def wait_cursor(): try: QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) yield finally: QApplication.restoreOverrideCursor()