Merge pull request #1169 from ixjlyons/mkqapp-default-arg

Replace default list arg with None
This commit is contained in:
Ogi Moore 2020-04-11 21:16:47 -07:00 committed by GitHub
commit a2053b13d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""
This module exists to smooth out some of the differences between PySide and PyQt4:
@ -329,7 +330,7 @@ if m is not None and list(map(int, m.groups())) < versionReq:
QAPP = None
def mkQApp(name="pyqtgraph", qt_args=[]):
def mkQApp(name="pyqtgraph", qt_args=None):
"""
Creates new QApplication or returns current instance if existing.
@ -342,5 +343,8 @@ def mkQApp(name="pyqtgraph", qt_args=[]):
global QAPP
QAPP = QtGui.QApplication.instance()
if QAPP is None:
QAPP = QtGui.QApplication([name] + qt_args)
args = [name]
if qt_args is not None:
args.extend(qt_args)
QAPP = QtGui.QApplication(args)
return QAPP