code: def with_wait_cursor(func):
      
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          QApplication.setOverrideCursor(
              QCursor(Qt.WaitCursor))
          try:
              ret_val = func(*args, **kwargs)
          finally:
              QApplication.restoreOverrideCursor()
          return ret_val
      return wrapper
docs: Show a wait cursor while the wrapped function is running. The cursor is
      restored as soon as the function exits.
  
      :param func: wrapped function