Changed the code generating QGraphicsTextItem to not use scene in the constructor anymore. 5_2_x

Wed, 03 Oct 2012 15:34:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 03 Oct 2012 15:34:18 +0200
branch
5_2_x
changeset 2093
060d051757a2
parent 2092
987aa24ec704
child 2096
63205cd717b5

Changed the code generating QGraphicsTextItem to not use scene in the constructor anymore.

Graphics/ImportsDiagram.py file | annotate | diff | comparison | revisions
Graphics/UMLClassDiagram.py file | annotate | diff | comparison | revisions
--- a/Graphics/ImportsDiagram.py	Wed Oct 03 14:38:06 2012 +0200
+++ b/Graphics/ImportsDiagram.py	Wed Oct 03 15:34:18 2012 +0200
@@ -104,10 +104,11 @@
         """
         initlist = glob.glob(os.path.join(self.packagePath, '__init__.*'))
         if len(initlist) == 0:
-            ct = QGraphicsTextItem(None, self.scene)
+            ct = QGraphicsTextItem(None)
             ct.setHtml(
                 self.trUtf8("The directory <b>'{0}'</b> is not a Python package.")\
                     .format(self.package))
+            self.scene.addItem(ct)
             return
         
         shapes = {}
--- a/Graphics/UMLClassDiagram.py	Wed Oct 03 14:38:06 2012 +0200
+++ b/Graphics/UMLClassDiagram.py	Wed Oct 03 15:34:18 2012 +0200
@@ -68,10 +68,11 @@
                 Preferences.getPython("Python3Extensions") + ['.rb']
             module = Utilities.ModuleParser.readModule(self.file, extensions=extensions)
         except ImportError:
-            ct = QGraphicsTextItem(None, self.scene)
+            ct = QGraphicsTextItem(None)
             ct.setHtml(
                 self.trUtf8("The module <b>'{0}'</b> could not be found.")
                     .format(self.file))
+            self.scene.addItem(ct)
             return
         
         if self.file not in self.allModules:
@@ -129,10 +130,11 @@
             self.__arrangeClasses(nodes, routes[:])
             self.__createAssociations(routes)
         else:
-            ct = QGraphicsTextItem(None, self.scene)
+            ct = QGraphicsTextItem(None)
             ct.setHtml(
                 self.trUtf8("The module <b>'{0}'</b> does not contain any classes.")\
                 .format(self.file))
+            self.scene.addItem(ct)
         
     def __arrangeClasses(self, nodes, routes, whiteSpaceFactor=1.2):
         """

eric ide

mercurial