[Eric] Is this enough to "Generage Dialog Code" for PySide at *.ui file on Python3.2 and ERIC5?

진석오 jsukoh at gmail.com
Thu May 17 07:19:42 BST 2012


Eric5 doesn't seem to generate dialog code for PySide.


--- CreateDialogCodeDialog.py.orig    Sun Apr 29 16:00:36 2012
+++ CreateDialogCodeDialog.py    Thu May 17 15:15:44 2012
@@ -317,8 +317,18 @@
                         tmplName =
os.path.join(getConfig('ericCodeTemplatesDir'),
                                                 "impl_pyqt.py2.tmpl")
                 else:
-                    tmplName =
os.path.join(getConfig('ericCodeTemplatesDir'),
+                ###################################################
+                # add PySide case
+                # just copy
site-packages\eric5\CodeTemplates\impl_pyside.py2.tmpl to
impl_pyside.py.tmpl
+                # before modifying this code
+                    if self.project.getProjectType() == "PySide":
+                        tmplName =
os.path.join(getConfig('ericCodeTemplatesDir'),
+                                                "impl_pyside.py.tmpl")
+                    else:
+                        tmplName =
os.path.join(getConfig('ericCodeTemplatesDir'),
                                             "impl_pyqt.py.tmpl")
+                # End of Modification
+                ###################################################
                 tmplFile = open(tmplName, 'r', encoding="utf-8")
                 template = tmplFile.read()
                 tmplFile.close()
@@ -388,7 +398,15 @@
             else:
                 pyqtSignatureFormat = '@pyqtSignature("{0}")'
         else:
-            pyqtSignatureFormat = '@pyqtSlot({0})'
+        ###################################################
+        # add PySide case
+        # before modifying this code
+            if self.project.getProjectType() == "PySide":
+                pyqtSignatureFormat = '@Slot({0})'
+            else:
+                pyqtSignatureFormat = '@pyqtSlot({0})'
+        # End of Modification
+        ####################################################
         for row in range(self.slotsModel.rowCount()):
             topItem = self.slotsModel.item(row)
             for childRow in range(topItem.rowCount()):


jinsuk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20120517/ae63d5c3/attachment.html>


More information about the Eric mailing list