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

Gopala Krishna A krishna.ggk at gmail.com
Sun Sep 21 09:31:39 UTC 2008


SVN commit 863137 by gopala:

Initial work on new implementation of LinePath. LinePath is now a
single dedicated QGraphicsItem which will handle all mouse events,
painting and other functionality.

This ensures AssociationWidget can focus more on actual "Association"
functionality rather than line management.

Sidenote: My first commit after an unnecessary long break!! More commits to follow.



 M  +4 -3      CMakeLists.txt  
 A             newlinepath.cpp   [License: GPL (v2+)]
 A             newlinepath.h   [License: GPL (v2+)]
 M  +7 -16     test.cpp  


--- branches/work/soc-umbrello/umbrello/CMakeLists.txt #863136:863137
@@ -345,8 +345,7 @@
     main.cpp
     messagewidget.cpp
     model_utils.cpp
-    widgetbase.cpp
-    umlwidget.cpp
+    newlinepath.cpp
     node.cpp
     nodewidget.cpp
     notewidget.cpp
@@ -395,13 +394,15 @@
     umlviewimageexporter.cpp
     umlviewimageexporterall.cpp
     umlviewimageexportermodel.cpp
+    umlwidget.cpp
     uniqueid.cpp
     uniqueconstraint.cpp
     usecase.cpp
     usecasewidget.cpp
-    widgethandle.cpp
     widget_factory.cpp
     widget_utils.cpp
+    widgetbase.cpp
+    widgethandle.cpp
     worktoolbar.cpp
 )
 
--- branches/work/soc-umbrello/umbrello/test.cpp #863136:863137
@@ -24,6 +24,7 @@
 #include "enum.h"
 #include "floatingdashlinewidget.h"
 #include "messagewidget.h"
+#include "newlinepath.h"
 #include "objectwidget.h"
 #include "textitem.h"
 #include "umlscene.h"
@@ -85,22 +86,12 @@
 
 void Test::testScene(UMLScene *scene)
 {
-    if (scene->getType() != Uml::dt_Sequence)
-        return;
-
-    UMLClassifier *obj = new UMLClassifier("hello");
-    ObjectWidget *wid = new ObjectWidget(obj);
-    wid->setPos(100, 100);
-
-    UMLClassifier *obj1 = new UMLClassifier("world");
-    ObjectWidget *wid1 = new ObjectWidget(obj1);
-    wid1->setPos(200, 100);
-
-    MessageWidget *msg = new MessageWidget(wid, wid1, Uml::sequence_message_asynchronous);
-
-    scene->addItem(wid);
-    scene->addItem(wid1);
-    scene->addItem(msg);
+    New::LinePath *path = new New::LinePath(0);
+    scene->addItem(path);
+    path->insertPoint(0, QPointF(100, 100));
+    path->insertPoint(1, QPointF(200, 50));
+    path->insertPoint(2, QPointF(400, 300));
+    path->setPen(QPen(Qt::blue));
 }
 
 void Test::updateWidgetGeometry(WidgetBase *wid)




More information about the umbrello-devel mailing list