Merge pull request #1166 from 2xB/fix-1165

pg.mkQApp: Pass non-empty string array to QApplication() as default
This commit is contained in:
Ogi Moore 2020-04-11 17:01:16 -07:00 committed by GitHub
commit 66b8c42ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,9 +329,18 @@ if m is not None and list(map(int, m.groups())) < versionReq:
QAPP = None
def mkQApp():
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