parameters: (func)
return_statement: return wrapper
docstring: Decorator to ensure QApplication has been created
docstring_summary: Decorator to ensure QApplication has been created
docstring_tokens: Decorator to ensure QApplication has been created
function: def _ensure_qapplication_started(func):
      """
      Decorator to ensure QApplication has been created
      """
      @wraps(func)
      def wrapper(*args, **kwargs):
          global _QAPP
          if QApplication.instance() is None:
              _QAPP = QApplication(['screenshot'])
          return func(*args, **kwargs)
  
      return wrapper
function_tokens: def _ensure_qapplication_started ( func ) : @ wraps ( func ) def wrapper ( * args , * * kwargs ) : global _QAPP if QApplication . instance ( ) is None : _QAPP = QApplication ( [ 'screenshot' ] ) return func ( * args , * * kwargs ) return wrapper