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

@@ -30,10 +30,10 @@ from ViewProviderHole import ViewProviderHole
class HoleGui:
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

View File

@@ -82,10 +82,10 @@ class TaskHole:
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

View File

@@ -13,10 +13,10 @@ def proceed():
compute()
except:
hide()
QtGui.qApp.restoreOverrideCursor()
QtGui.QApplication.restoreOverrideCursor()
def compute():
QtGui.qApp.setOverrideCursor(QtCore.Qt.WaitCursor)
QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
if FreeCAD.ActiveDocument==None:
FreeCAD.newDocument("Gear")
@@ -232,7 +232,7 @@ def compute():
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
QtGui.qApp.restoreOverrideCursor()
QtGui.QApplication.restoreOverrideCursor()
hide()

View File

@@ -31,7 +31,7 @@ class TaskWizardShaft:
Gui = FreeCADGui
def __init__(self, doc):
mw = QtGui.qApp.activeWindow()
mw = QtGui.QApplication.activeWindow()
#cw = mw.centralWidget() # This is a qmdiarea widget
cw = mw.findChild(QtGui.QMdiArea)
self.doc = doc
@@ -87,7 +87,7 @@ class TaskWizardShaft:
self.form.setLayout(layout)
# Switch to feature window
mdi=QtGui.qApp.activeWindow().findChild(QtGui.QMdiArea)
mdi=QtGui.QApplication.activeWindow().findChild(QtGui.QMdiArea)
cw.setActiveSubWindow(featureWindow)
def slotAllx(self):