2019-10-15 00:00:18 +02:00
|
|
|
import asyncio
|
|
|
|
import sys
|
|
|
|
|
2020-06-02 23:23:14 +02:00
|
|
|
import qasync
|
2019-10-15 00:00:18 +02:00
|
|
|
from PyQt5 import QtWidgets
|
|
|
|
|
|
|
|
qtapp = None
|
|
|
|
loop = None
|
|
|
|
|
|
|
|
def init_qtapp():
|
|
|
|
global qtapp, loop
|
|
|
|
if qtapp is None:
|
|
|
|
qtapp = QtWidgets.QApplication(sys.argv)
|
2020-06-02 23:23:14 +02:00
|
|
|
loop = qasync.QEventLoop(qtapp)
|
2019-10-15 00:00:18 +02:00
|
|
|
asyncio.set_event_loop(loop)
|
2020-02-27 16:58:57 +01:00
|
|
|
qtapp.processEvents()
|
2019-10-15 00:00:18 +02:00
|
|
|
return qtapp, loop
|