Merge pull request #682 from campagnola/qapp-fix

Fix: mkQApp returned None if a QApplication was already created elsewhere
This commit is contained in:
Luke Campagnola 2018-05-04 14:05:12 -07:00 committed by GitHub
commit 3ffd7dbb97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -276,7 +276,8 @@ if m is not None and list(map(int, m.groups())) < versionReq:
QAPP = None
def mkQApp():
global QAPP
if QtGui.QApplication.instance() is None:
global QAPP
QAPP = QtGui.QApplication.instance()
if QAPP is None:
QAPP = QtGui.QApplication([])
return QAPP