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

Andi Fischer andi.fischer at hispeed.ch
Sat Apr 28 12:59:07 UTC 2012


SVN commit 1292184 by fischer:

Differences to trunk reduced.

 M  +0 -2      toolbarstateassociation.h  
 M  +11 -13    toolbarstatemessages.cpp  
 M  +4 -5      toolbarstatemessages.h  


--- branches/work/soc-umbrello/umbrello/toolbarstateassociation.h #1292183:1292184
@@ -14,8 +14,6 @@
 #include "basictypes.h"
 #include "toolbarstatepool.h"
 
-class QGraphicsLineItem;
-
 /**
  * Association tool to create associations between widgets.
  * With association tool, two widgets are selected clicking with left button on
--- branches/work/soc-umbrello/umbrello/toolbarstatemessages.cpp #1292183:1292184
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -31,12 +31,13 @@
  * @param umlScene The UMLScene to use.
  */
 ToolBarStateMessages::ToolBarStateMessages(UMLScene *umlScene)
-  : ToolBarStatePool(umlScene)
+  : ToolBarStatePool(umlScene),
+    m_firstObject(0),
+    m_messageLine(0),
+    m_isObjectWidgetLine(false),
+    xclick(0),
+    yclick(0)
 {
-    m_firstObject = 0;
-    m_messageLine = 0;
-    xclick = 0;
-    yclick = 0;
 }
 
 /**
@@ -112,12 +113,12 @@
 
     ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos());
     if (objectWidgetLine) {
-        qDebug() << Q_FUNC_INFO << "Object detected";
+        uDebug() << Q_FUNC_INFO << "Object detected";
         setCurrentWidget(objectWidgetLine);
         m_isObjectWidgetLine = true;
         return;
     }
-    qDebug() << Q_FUNC_INFO << "Object NOT detected";
+    uDebug() << Q_FUNC_INFO << "Object NOT detected";
     //commit 515177 fixed a setting creation messages only working properly at 100% zoom
     //However, the applied patch doesn't seem to be necessary no more, so it was removed
     //The widgets weren't got from UMLView, but from a method in this class similarto the
@@ -190,7 +191,7 @@
         xclick = m_pMouseEvent->scenePos().x();
         yclick = m_pMouseEvent->scenePos().y();
 
-        m_messageLine = new QGraphicsLineItem();
+        m_messageLine = new UMLSceneLineItem();
         m_pUMLScene->addItem(m_messageLine);
         qreal x = m_pMouseEvent->scenePos().x(), y = m_pMouseEvent->scenePos().y();
         m_messageLine->setLine(x, y, x, y);
@@ -219,12 +220,11 @@
         MessageWidget* message = new MessageWidget(m_firstObject, QPointF(xclick, yclick), msgType);
         setupMessageWidget(message);
         cleanMessage();
-
         xclick = 0;
         yclick = 0;
     }
     else {
-        m_messageLine = new QGraphicsLineItem();
+        m_messageLine = new UMLSceneLineItem();
         m_pUMLScene->addItem(m_messageLine);
         qreal x = m_pMouseEvent->scenePos().x();
         qreal y = m_pMouseEvent->scenePos().y();
@@ -261,14 +261,12 @@
     if (messageType == CreationMessage) {
         msgType = Uml::sequence_message_creation;
         y = m_messageLine->line().p1().y();
-
     }
 
     MessageWidget* message = new MessageWidget(m_firstObject,
                                                secondObject, msgType);
     message->setPos(message->pos().x(), y);
     setupMessageWidget(message);
-
     cleanMessage();
 }
 
--- branches/work/soc-umbrello/umbrello/toolbarstatemessages.h #1292183:1292184
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -14,7 +14,6 @@
 #include "basictypes.h"
 #include "toolbarstatepool.h"
 
-class QGraphicsLineItem;
 class MessageWidget;
 class ObjectWidget;
 
@@ -100,7 +99,7 @@
      * The message line shown while the first widget is selected and the
      * second one wasn't selected yet.
      */
-    QGraphicsLineItem* m_messageLine;
+    UMLSceneLineItem* m_messageLine;
 
     /**
      * If there is a current widget, it is true if the press event happened on
@@ -114,8 +113,8 @@
     /**
      * x and y clicked for lost and found messages
      */
-    qreal xclick;
-    qreal yclick;
+    UMLSceneValue xclick;
+    UMLSceneValue yclick;
 
 };
 




More information about the umbrello-devel mailing list