MCPcopy Create free account
hub / github.com/LabPy/lantz / start_gui_app

Function start_gui_app

lantz/ui/app.py:232–250  ·  view source on GitHub ↗
(backend, frontend_class, qapp_or_args=None)

Source from the content-addressed store, hash-verified

230
231
232def start_gui_app(backend, frontend_class, qapp_or_args=None):
233 if isinstance(qapp_or_args, QtGui.QApplication):
234 qapp = qapp_or_args
235 else:
236 qapp = QtGui.QApplication(qapp_or_args or [''])
237
238 background_thread = QtCore.QThread()
239 backend.moveToThread(background_thread)
240 background_thread.start()
241
242 frontend = frontend_class(backend=backend)
243 frontend.show()
244
245 qapp.aboutToQuit.connect(background_thread.quit)
246
247 if sys.platform.startswith('darwin'):
248 frontend.raise_()
249
250 sys.exit(qapp.exec_())
251
252
253def start_test_app(target, width=500, qapp_or_args=None):

Callers 8

scan.pyFile · 0.90
featscan.pyFile · 0.90
loop.pyFile · 0.90
example2-gui.pyFile · 0.90
example5-config.pyFile · 0.90
example4-gui2.pyFile · 0.90
example2-plot.pyFile · 0.90

Calls 2

startMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected