__init__.py 310 B

12345678910111213141516
  1. import asyncio
  2. import sys
  3. import quamash
  4. from PyQt5 import QtWidgets
  5. qtapp = None
  6. loop = None
  7. def init_qtapp():
  8. global qtapp, loop
  9. if qtapp is None:
  10. qtapp = QtWidgets.QApplication(sys.argv)
  11. loop = quamash.QEventLoop(qtapp)
  12. asyncio.set_event_loop(loop)
  13. return qtapp, loop