INNER CODE UNIT · Python
qtsleep
toolsforexperiments/plottr · plottr/__init__.py:54
def qtsleep(delay_sec: float) -> None:
"""sleep function that allows QT event processing in the background."""
loop = QtCore.QEventLoop()
QtCore.QTimer.singleShot(int(delay_sec * 1000), loop.quit)
loop.exec()
def qtapp() -> QtWidgets.QApplication:
"""make a QT application that can be interrupted by Ctrl+C in the terminal."""
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QtWidgets.QApplication(sys.argv)
return app
_garbageCollector: Optional[GarbageCollector] = None
def enableEventLoopGarbageCollection(app: QtCore.QCoreApplication,