PySide2: qApp -> QApplication

This commit is contained in:
looooo
2018-04-12 17:03:30 +02:00
committed by wmayer
parent 0bd9f17baf
commit be5ea8391c
33 changed files with 63 additions and 63 deletions

View File

@@ -14,7 +14,7 @@ def makeSnapshotWithGui():
import FreeCADGui
def getMainWindow():
toplevel = QtGui.qApp.topLevelWidgets()
toplevel = QtGui.QApplication.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
return i
@@ -37,7 +37,7 @@ def makeSnapshotWithGui():
view.saveImage('crystal.png',800,600,'Current')
FreeCAD.closeDocument(doc.Name)
# close the application
QtGui.qApp.quit()
QtGui.QApplication.quit()
def makeSnapshotWithoutGui():
from pivy import coin

View File

@@ -77,10 +77,10 @@ class TaskPanel:
def getMainWindow(self):
"returns the main window"
# using QtGui.qApp.activeWindow() isn't very reliable because if another
# using QtGui.QApplication.activeWindow() isn't very reliable because if another
# widget than the mainwindow is active (e.g. a dialog) the wrong widget is
# returned
toplevel = QtGui.qApp.topLevelWidgets()
toplevel = QtGui.QApplication.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
return i