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

Function start_gui

lantz/ui/app.py:279–303  ·  view source on GitHub ↗

Start a single window application with a form generated from a designer file. :param ui_filename: the full path of a file generated with QtDesigner. :param drivers: a driver object or a collection of drivers. :param qapp_or_args: arguments to be passed to QApplication.

(ui_filename, drivers, qapp_or_args=None)

Source from the content-addressed store, hash-verified

277
278
279def start_gui(ui_filename, drivers, qapp_or_args=None):
280 """Start a single window application with a form generated from
281 a designer file.
282
283 :param ui_filename: the full path of a file generated with QtDesigner.
284 :param drivers: a driver object or a collection of drivers.
285 :param qapp_or_args: arguments to be passed to QApplication.
286 """
287
288 if isinstance(qapp_or_args, QtGui.QApplication):
289 qapp = qapp_or_args
290 else:
291 qapp = QtGui.QApplication(qapp_or_args or [''])
292
293 main = QtGui.loadUi(ui_filename)
294
295 if isinstance(drivers, Driver):
296 connect_driver(main, drivers)
297 else:
298 connect_setup(main, drivers)
299
300 main.show()
301 if sys.platform.startswith('darwin'):
302 main.raise_()
303 qapp.exec_()

Callers

nothing calls this directly

Calls 2

connect_driverFunction · 0.85
connect_setupFunction · 0.85

Tested by

no test coverage detected