Switched TemplatePyMod scripts to PySide

This commit is contained in:
Yorik van Havre
2014-01-09 18:46:16 -02:00
parent bb22b13a05
commit b357fd6e02
4 changed files with 58 additions and 58 deletions

View File

@@ -1,17 +1,17 @@
"""
Examples for customizing the FreeCAD application with PyQt facilities.
Examples for customizing the FreeCAD application with PySide facilities.
(c) 2007 Werner Mayer LGPL
"""
__author__ = "Werner Mayer <werner.wm.mayer@gmx.de>"
__author__ = "Werner Mayer <werner.wm.mayer@gmx.de>"
from PyQt4 import QtCore,QtGui
from PySide import QtCore,QtGui
import FreeCAD,FreeCADGui, __main__
class MainWindow:
def __init__(self):
self.app = QtGui.qApp
self.mw = self.app.activeWindow()
self.mw = FreeCADGui.getMainWindow()
self.dock = {}
def setWindowTitle(self, name):
@@ -40,15 +40,15 @@ class MainWindow:
def aboutQt(self):
QtGui.QMessageBox.aboutQt(self.mw, self.mw.tr("About Qt"))
class PythonQtWorkbench (__main__.Workbench):
"Python Qt workbench object"
Icon = "python"
MenuText = "PyQt sandbox"
ToolTip = "Python Qt workbench"
class PythonQtWorkbench (__main__.Workbench):
"Python Qt workbench object"
Icon = "python"
MenuText = "PySide sandbox"
ToolTip = "Python Qt workbench"
def __init__(self):
self.mw = QtGui.qApp.activeWindow()
self.mw = FreeCADGui.getMainWindow()
self.dock = {}
self.item = []
@@ -71,10 +71,10 @@ class PythonQtWorkbench (__main__.Workbench):
QtCore.QObject.connect(self.item[0], QtCore.SIGNAL("triggered()"), self.information)
QtCore.QObject.connect(self.item[1], QtCore.SIGNAL("triggered()"), self.warning)
QtCore.QObject.connect(self.item[2], QtCore.SIGNAL("triggered()"), self.critical)
def Activated(self):
self.__title__ = self.mw.windowTitle()
self.mw.setWindowTitle("FreeCAD -- PythonQt")
self.mw.setWindowTitle("FreeCAD -- PythonQt")
d = QtGui.QDockWidget()
d.setWindowTitle("Calendar")
@@ -92,8 +92,8 @@ class PythonQtWorkbench (__main__.Workbench):
self.menu.setTitle("Python Qt")
self.menu.menuAction().setVisible(True)
def Deactivated(self):
def Deactivated(self):
self.mw.setWindowTitle(self.__title__)
self.dock.clear()
FreeCADGui.addWorkbench(PythonQtWorkbench)
self.dock.clear()
FreeCADGui.addWorkbench(PythonQtWorkbench)