[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Wed Aug 27 17:29:14 UTC 2008


SVN commit 853410 by gopala:

1) Moved SeqLineWidget creation code inside ObjectWidget to
   appropriate method (attributeChange() to itemChange())

2) Update MessageWidget drawing, size and position on ObjectWidget's
   size change.



 M  +21 -15    objectwidget.cpp  


--- branches/work/soc-umbrello/umbrello/objectwidget.cpp #853409:853410
@@ -438,25 +438,13 @@
         TextItemGroup *grp = textItemGroupAt(0);
         const QSizeF grpSize = grp->minimumSize();
 
-        // Create/delete Sequential line based on the type of diagram.
-        if (uScene) {
-            if (uScene->getType() == Uml::dt_Sequence) {
-                if (!m_sequentialLine) {
-                    m_sequentialLine = new SeqLineWidget(this);
-                    m_sequentialLine->setLength(255);
-                }
-            }
-            else {
-                delete m_sequentialLine;
-                m_sequentialLine = 0;
-            }
-        }
-
         // Firstly align the sequential line.
         if (m_sequentialLine) {
             m_sequentialLine->setPos(r.center().x(), r.bottom());
         }
-
+        foreach(MessageWidget *msg, m_messages) {
+            msg->handleObjectMove(this);
+        }
         // Now update text position and also the path.
 
         // Reset the path
@@ -538,6 +526,24 @@
             msg->handleObjectMove(this);
         }
     }
+    else if (change == ItemSceneHasChanged) {
+        // Create/delete Sequential line based on the type of diagram.
+        if (uScene) {
+            if (uScene->getType() == Uml::dt_Sequence) {
+                if (!m_sequentialLine) {
+                    m_sequentialLine = new SeqLineWidget(this);
+                    m_sequentialLine->setLength(255);
+                }
+                const QRectF r = rect();
+                m_sequentialLine->setPos(r.center().x(), r.bottom());
+            }
+            else {
+                delete m_sequentialLine;
+                m_sequentialLine = 0;
+            }
+        }
+
+    }
     return NewUMLRectWidget::itemChange(change, value);
 }
 




More information about the umbrello-devel mailing list