PySide2: qApp -> QApplication
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user