PySide2: qApp -> QApplication
This commit is contained in:
@@ -828,9 +828,9 @@ def survey(callback=False):
|
||||
FreeCAD.SurveyDialog.update(1,t)
|
||||
if FreeCAD.GuiUp and t:
|
||||
if showUnit:
|
||||
QtGui.qApp.clipboard().setText(t)
|
||||
QtGui.QApplication.clipboard().setText(t)
|
||||
else:
|
||||
QtGui.qApp.clipboard().setText(str(u.Value))
|
||||
QtGui.QApplication.clipboard().setText(str(u.Value))
|
||||
else:
|
||||
# single element(s)
|
||||
for el in o.SubElementNames:
|
||||
@@ -870,9 +870,9 @@ def survey(callback=False):
|
||||
FreeCAD.Console.PrintMessage("Object: " + n + ", Element: " + el + ", Zcoord: " + utf8_decode(t) + "\n")
|
||||
if FreeCAD.GuiUp and t:
|
||||
if showUnit:
|
||||
QtGui.qApp.clipboard().setText(t)
|
||||
QtGui.QApplication.clipboard().setText(t)
|
||||
else:
|
||||
QtGui.qApp.clipboard().setText(str(u.Value))
|
||||
QtGui.QApplication.clipboard().setText(str(u.Value))
|
||||
|
||||
FreeCAD.SurveyObserver.selection.extend(newsels)
|
||||
if hasattr(FreeCAD,"SurveyObserver"):
|
||||
@@ -990,9 +990,9 @@ class SurveyTaskPanel:
|
||||
t = u.getUserPreferred()[0]
|
||||
t = t.encode("utf8")
|
||||
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("surveyUnits",True):
|
||||
QtGui.qApp.clipboard().setText(t)
|
||||
QtGui.QApplication.clipboard().setText(t)
|
||||
else:
|
||||
QtGui.qApp.clipboard().setText(str(u.Value/u.getUserPreferred()[1]))
|
||||
QtGui.QApplication.clipboard().setText(str(u.Value/u.getUserPreferred()[1]))
|
||||
|
||||
def clipArea(self):
|
||||
if hasattr(FreeCAD,"SurveyObserver"):
|
||||
@@ -1000,9 +1000,9 @@ class SurveyTaskPanel:
|
||||
t = u.getUserPreferred()[0]
|
||||
t = t.encode("utf8").replace("^2","²")
|
||||
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("surveyUnits",True):
|
||||
QtGui.qApp.clipboard().setText(t)
|
||||
QtGui.QApplication.clipboard().setText(t)
|
||||
else:
|
||||
QtGui.qApp.clipboard().setText(str(u.Value/u.getUserPreferred()[1]))
|
||||
QtGui.QApplication.clipboard().setText(str(u.Value/u.getUserPreferred()[1]))
|
||||
|
||||
def newline(self,length=0,area=0):
|
||||
FreeCADGui.Selection.clearSelection()
|
||||
@@ -1050,7 +1050,7 @@ class SurveyTaskPanel:
|
||||
import csv
|
||||
rows = self.tree.topLevelItemCount()
|
||||
if rows:
|
||||
filename = QtGui.QFileDialog.getSaveFileName(QtGui.qApp.activeWindow(), translate("Arch","Export CSV File"), None, "CSV file (*.csv)");
|
||||
filename = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), translate("Arch","Export CSV File"), None, "CSV file (*.csv)");
|
||||
if filename:
|
||||
with open(filename[0].encode("utf8"), 'wb') as csvfile:
|
||||
csvfile = csv.writer(csvfile,delimiter="\t")
|
||||
|
||||
@@ -116,7 +116,7 @@ class Nester:
|
||||
self.setCounter(self.progress)
|
||||
if FreeCAD.GuiUp:
|
||||
from PySide import QtGui
|
||||
QtGui.qApp.processEvents()
|
||||
QtGui.QApplication.processEvents()
|
||||
if not self.running:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -1344,7 +1344,7 @@ class NestTaskPanel:
|
||||
self.form.ButtonStop.setEnabled(True)
|
||||
self.form.ButtonStart.setEnabled(False)
|
||||
self.form.ButtonPreview.setEnabled(False)
|
||||
QtGui.qApp.processEvents()
|
||||
QtGui.QApplication.processEvents()
|
||||
result = self.nester.run()
|
||||
self.form.progressBar.hide()
|
||||
self.form.ButtonStart.setEnabled(True)
|
||||
|
||||
@@ -314,7 +314,7 @@ class _ArchScheduleTaskPanel:
|
||||
self.form.list.setRowCount(0)
|
||||
|
||||
def importCSV(self):
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(), translate("Arch","Import CSV File"), None, "CSV file (*.csv)");
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.QApplication.activeWindow(), translate("Arch","Import CSV File"), None, "CSV file (*.csv)");
|
||||
if filename:
|
||||
self.form.list.clearContents()
|
||||
import csv
|
||||
@@ -333,7 +333,7 @@ class _ArchScheduleTaskPanel:
|
||||
def exportCSV(self):
|
||||
if self.obj:
|
||||
if self.obj.Result:
|
||||
filename = QtGui.QFileDialog.getSaveFileName(QtGui.qApp.activeWindow(), translate("Arch","Export CSV File"), None, "CSV file (*.csv)");
|
||||
filename = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), translate("Arch","Export CSV File"), None, "CSV file (*.csv)");
|
||||
if filename:
|
||||
# the following line crashes, couldn't fnid out why
|
||||
# self.obj.Result.exportFile(str(filename[0].encode("utf8")))
|
||||
|
||||
@@ -184,7 +184,7 @@ def explore(filename=None):
|
||||
|
||||
if not filename:
|
||||
from PySide import QtGui
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(),'IFC files','*.ifc')
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.QApplication.activeWindow(),'IFC files','*.ifc')
|
||||
if filename:
|
||||
filename = filename[0]
|
||||
|
||||
|
||||
@@ -1388,7 +1388,7 @@ def explore(filename=None):
|
||||
"explore the contents of an ifc file in a Qt dialog"
|
||||
if not filename:
|
||||
from PySide import QtGui
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(),'IFC files','*.ifc')
|
||||
filename = QtGui.QFileDialog.getOpenFileName(QtGui.QApplication.activeWindow(),'IFC files','*.ifc')
|
||||
if filename:
|
||||
filename = filename[0]
|
||||
if filename:
|
||||
|
||||
Reference in New Issue
Block a user