[Uml-devel] KDE/kdesdk/umbrello/umbrello

Ralf Habacker ralf.habacker at gmail.com
Thu Aug 23 04:09:45 UTC 2012


SVN commit 1312465 by habacker:

Renamed Qt event related classes to UMLScene counterpart to reduce differences to soc branch.

 M  +9 -9      toolbarstate.cpp  
 M  +6 -6      toolbarstatemessages.cpp  
 M  +2 -2      umlscene.cpp  
 M  +8 -1      umlscene.h  
 M  +1 -0      umlview.h  
 M  +1 -1      widgets/messagewidget.cpp  
 M  +1 -1      widgets/messagewidget.h  
 M  +2 -2      widgets/toolbarstateonewidget.cpp  
 M  +1 -1      widgets/umlwidget.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstate.cpp #1312464:1312465
@@ -84,7 +84,7 @@
     m_pUMLScene->emitRemovePopupMenu();
 
     // TODO: Check who needs this.
-    m_pUMLScene->setPos(m_pMouseEvent->scenePos());
+    m_pUMLScene->setPos(m_pMouseEvent->pos());
 
     //TODO check why
     m_pUMLScene->setPaste(false);
@@ -115,7 +115,7 @@
 
     // Set the position of the mouse
     // TODO, should only be available in this state?
-    m_pUMLScene->setPos(m_pMouseEvent->scenePos());
+    m_pUMLScene->setPos(m_pMouseEvent->pos());
 
     m_pUMLScene->activeView()->viewport()->setMouseTracking(false);
 
@@ -146,8 +146,8 @@
 {
     setMouseEvent(ome, QEvent::MouseButtonDblClick);
 
-    UMLWidget* currentWidget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
-    AssociationWidget* currentAssociation = associationAt(m_pMouseEvent->scenePos());
+    UMLWidget* currentWidget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
+    AssociationWidget* currentAssociation = associationAt(m_pMouseEvent->pos());
     if (currentWidget) {
         setCurrentWidget(currentWidget);
         mouseDoubleClickWidget();
@@ -256,7 +256,7 @@
 void ToolBarState::setCurrentElement()
 {
     // Check associations.
-    AssociationWidget* association = associationAt(m_pMouseEvent->scenePos());
+    AssociationWidget* association = associationAt(m_pMouseEvent->pos());
     if (association) {
         setCurrentAssociation(association);
         return;
@@ -264,27 +264,27 @@
 
     // Check messages.
     //TODO check why message widgets are treated different
-    MessageWidget* message = messageAt(m_pMouseEvent->scenePos());
+    MessageWidget* message = messageAt(m_pMouseEvent->pos());
     if (message) {
         setCurrentWidget(message);
         return;
     }
 
     //TODO check why message widgets are treated different
-    FloatingDashLineWidget* floatingline = floatingLineAt(m_pMouseEvent->scenePos());
+    FloatingDashLineWidget* floatingline = floatingLineAt(m_pMouseEvent->pos());
     if (floatingline) {
         setCurrentWidget(floatingline);
         return;
     }
 
-    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetDestructionBox(m_pMouseEvent->scenePos());
+    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetDestructionBox(m_pMouseEvent->pos());
     if (objectWidgetLine) {
         setCurrentWidget(objectWidgetLine);
         return;
     }
 
     // Check widgets.
-    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
+    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
     if (widget) {
         setCurrentWidget(widget);
         return;
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstatemessages.cpp #1312464:1312465
@@ -110,7 +110,7 @@
 {
     m_isObjectWidgetLine = false;
 
-    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos());
+    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->pos());
     if (objectWidgetLine) {
         uDebug() << Q_FUNC_INFO << "Object detected";
         setCurrentWidget(objectWidgetLine);
@@ -122,7 +122,7 @@
     //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
     //one in UMLView but containing special code to handle the zoom
-    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
+    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
     if (widget) {
         setCurrentWidget(widget);
         return;
@@ -176,8 +176,8 @@
     Uml::Sequence_Message_Type msgType = getMessageType();
 
     if (m_firstObject && msgType ==  Uml::sequence_message_lost) {
-        xclick = m_pMouseEvent->scenePos().x();
-        yclick = m_pMouseEvent->scenePos().y();
+        xclick = m_pMouseEvent->pos().x();
+        yclick = m_pMouseEvent->pos().y();
 
         MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject, xclick, yclick, msgType);
         setupMessageWidget(message);
@@ -187,8 +187,8 @@
     }
 
     else if (!m_firstObject && msgType == Uml::sequence_message_found && xclick == 0 && yclick == 0) {
-        xclick = m_pMouseEvent->scenePos().x();
-        yclick = m_pMouseEvent->scenePos().y();
+        xclick = m_pMouseEvent->pos().x();
+        yclick = m_pMouseEvent->pos().y();
 
         m_messageLine = new UMLSceneLineItem();
         m_messageLine->setCanvas(m_pUMLScene->canvas());
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1312464:1312465
@@ -1627,13 +1627,13 @@
  */
 void UMLScene::mousePressEvent(UMLSceneMouseEvent* event)
 {
-    UMLWidget* widget = widgetAt(event->scenePos());
+    UMLWidget* widget = widgetAt(event->pos());
     if (widget) {
         DEBUG(DBG_SRC) << "widget = " << widget->name() << " / type = " << widget->baseTypeStr();
         showDocumentation(widget, true);
     }
     else {
-        AssociationWidget* association = associationAt(event->scenePos());
+        AssociationWidget* association = associationAt(event->pos());
         if (association) {
             DEBUG(DBG_SRC) << "widget = " << association->name() << " / type = " << association->baseTypeStr();
             showDocumentation(association, true);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.h #1312464:1312465
@@ -72,8 +72,12 @@
 typedef QKeyEvent UMLSceneKeyEvent;
 typedef QHoverEvent UMLSceneHoverEvent;
 typedef QContextMenuEvent UMLSceneContextMenuEvent;
-//typedef QDragDropEvent UMLSceneDragDropEvent;
+typedef QDropEvent UMLSceneDragDropEvent;
+typedef QDragEnterEvent UMLSceneDragEnterEvent;
+typedef QDragMoveEvent UMLSceneDragMoveEvent;
+typedef QMouseEvent UMLSceneMoveEvent;
 
+#if 0
 /**
  * Qt3 migration wrapper for QMouseEvent.
  */
@@ -89,6 +93,9 @@
         return pos();
     }
 };
+#else
+#define UMLSceneMouseEvent QMouseEvent 
+#endif
 
 typedef Q3CanvasItem UMLSceneItem;
 typedef Q3CanvasItemList UMLSceneItemList;
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #1312464:1312465
@@ -11,6 +11,7 @@
 #ifndef UMLVIEW_H
 #define UMLVIEW_H
 
+#include "umlscene.h"
 #include <Q3CanvasView>
 
 class ToolBarState;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/messagewidget.cpp #1312464:1312465
@@ -558,7 +558,7 @@
     }
 }
 
-void MessageWidget::moveEvent(QMoveEvent* /*m*/)
+void MessageWidget::moveEvent(UMLSceneMoveEvent* /*m*/)
 {
     //uDebug() << "m_pFText is " << m_pFText;
     if (!m_pFText) {
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/messagewidget.h #1312464:1312465
@@ -173,7 +173,7 @@
     Uml::Sequence_Message_Type m_sequenceMessageType;
 
 private:
-    void moveEvent(QMoveEvent *m);
+    void moveEvent(UMLSceneMoveEvent *m);
     void resizeEvent(QResizeEvent *re);
 
     void init();
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/toolbarstateonewidget.cpp #1312464:1312465
@@ -90,14 +90,14 @@
 void ToolBarStateOneWidget::setCurrentElement()
 {
     m_isObjectWidgetLine = false;
-    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos());
+    ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->pos());
     if (objectWidgetLine) {
         setCurrentWidget(objectWidgetLine);
         m_isObjectWidgetLine = true;
         return;
     }
 
-    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
+    UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
     if (widget) {
         setCurrentWidget(widget);
         return;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1312464:1312465
@@ -229,7 +229,7 @@
     virtual void mouseDoubleClickEvent(UMLSceneMouseEvent *me);
 
 protected:
-    virtual void moveEvent(UMLSceneMouseEvent *me);
+    virtual void moveEvent(UMLSceneMoveEvent *me);
 
     virtual void constrain(UMLSceneValue& width, UMLSceneValue& height);
 




More information about the umbrello-devel mailing list