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