manager/qubesmanager/tests/__init__.py
2020-07-30 03:05:39 +02:00

18 lines
334 B
Python

import asyncio
import sys
import qasync
from PyQt5 import QtWidgets
qtapp = None
loop = None
def init_qtapp():
global qtapp, loop
if qtapp is None:
qtapp = QtWidgets.QApplication(sys.argv)
loop = qasync.QEventLoop(qtapp)
asyncio.set_event_loop(loop)
qtapp.processEvents()
return qtapp, loop