pg.mkQApp: Pass default application name to Qt, added documentation

This commit is contained in:
2xB 2020-04-12 00:43:16 +02:00
parent 6f4048596b
commit be1ed14bd0

View File

@ -329,9 +329,18 @@ if m is not None and list(map(int, m.groups())) < versionReq:
QAPP = None
def mkQApp():
global QAPP
def mkQApp(name="pyqtgraph", qt_args=[]):
"""
Creates new QApplication or returns current instance if existing.
============== =================================================================================
**Arguments:**
name Application name, passed to Qt
qt_args Array of command line arguments passed to Qt
============== =================================================================================
"""
global QAPP
QAPP = QtGui.QApplication.instance()
if QAPP is None:
QAPP = QtGui.QApplication([])
QAPP = QtGui.QApplication([name] + qt_args)
return QAPP