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

Gaël de Chalendar kleag at free.fr
Wed Jul 26 13:19:54 UTC 2006


SVN commit 566530 by kleag:

Ported calls to QMouseEvent::state() making WorkToolBar work.

 M  +2 -2      associationwidget.cpp  
 M  +5 -3      toolbarstate.cpp  
 M  +1 -1      toolbarstatearrow.cpp  
 M  +1 -1      toolbarstateother.cpp  
 M  +3 -0      toolbarstatepool.cpp  
 M  +1 -1      umllistview.cpp  
 M  +1 -1      umlview.cpp  
 M  +7 -6      umlwidgetcontroller.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #566529:566530
@@ -2198,7 +2198,7 @@
     // See if the user has clicked on a point to start moving the line segment
     // from that point
     checkPoints(mep);
-    if( me -> state() != Qt::ShiftButton )
+    if( me -> modifiers() != Qt::ShiftModifier )
         m_pView -> clearSelected();
     setSelected( !m_bSelected );
 }
@@ -2520,7 +2520,7 @@
 }
 
 void AssociationWidget::mouseMoveEvent(QMouseEvent* me) {
-    if( me->state() != Qt::LeftButton) {
+    if( me->button() != Qt::LeftButton) {
         return;
     }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstate.cpp #566529:566530
@@ -14,6 +14,8 @@
 #include <qmatrix.h> // need for inverseWorldMatrix.map
 #include <qevent.h>
 
+#include <kdebug.h>
+
 #include "toolbarstate.h"
 #include "umlview.h"
 #include "umlwidget.h"
@@ -44,7 +46,7 @@
     if (m_pMouseEvent) delete m_pMouseEvent;
 
     m_pMouseEvent = new QMouseEvent(type, m_pUMLView->inverseWorldMatrix().map(ome->pos()),
-                                    ome->button(),ome->state());
+                                    ome->button(),ome->buttons(),ome->modifiers());
 }
 
 void ToolBarState::mousePress(QMouseEvent* ome)
@@ -90,7 +92,7 @@
 
 void ToolBarState::changeTool()
 {
-    if (m_pMouseEvent->state() == Qt::RightButton)
+    if (m_pMouseEvent->button() == Qt::RightButton)
     {
         /* if the user right clicks on the diagram, first the default tool is
          * selected from the toolbar; this only happens when the default tool
@@ -101,7 +103,7 @@
         UMLApp::app()->getWorkToolBar()->setDefaultTool();
     }
 
-    if (m_pMouseEvent->state() != Qt::LeftButton)
+    if (m_pMouseEvent->button() != Qt::LeftButton)
     {
         m_pUMLView->viewport()->setMouseTracking( false );
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstatearrow.cpp #566529:566530
@@ -76,7 +76,7 @@
 {
     m_pUMLView->viewport()->setMouseTracking( false );
 
-    if (m_pMouseEvent->state() == Qt::RightButton)
+    if (m_pMouseEvent->button() == Qt::RightButton)
     {
 
         if (m_bWidgetSelected)
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstateother.cpp #566529:566530
@@ -160,7 +160,7 @@
 {
     ToolBarStatePool::mouseRelease(ome);
 
-    if (ome->state() == Qt::LeftButton)
+    if (ome->button() == Qt::LeftButton)
     {
         if (!newWidget())
         {
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstatepool.cpp #566529:566530
@@ -14,6 +14,9 @@
 #include "toolbarstatepool.h"
 
 #include <qevent.h>
+
+#include <kdebug.h>
+
 #include "umlview.h"
 #include "umldoc.h"
 
--- trunk/KDE/kdesdk/umbrello/umbrello/umllistview.cpp #566529:566530
@@ -168,7 +168,7 @@
 void UMLListView::contentsMousePressEvent(QMouseEvent *me) {
     if( m_doc -> getCurrentView() )
         m_doc -> getCurrentView() -> clearSelected();
-    if( me -> state() != Qt::ShiftButton )
+    if( me -> modifiers() != Qt::ShiftModifier )
         clearSelection();
     QPoint pt = this->Q3ScrollView::contentsToViewport( me->pos() );
     UMLListViewItem * item = (UMLListViewItem*)itemAt(pt);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #566529:566530
@@ -1048,7 +1048,7 @@
 
 //FIXME Doesn't work with the new UMLWidgetController
 // void UMLView::moveSelected(UMLWidget * w, int x, int y) {
-//     QMouseEvent me(QMouseEvent::MouseMove, QPoint(x,y), Qt::LeftButton, Qt::ShiftButton);
+//     QMouseEvent me(QMouseEvent::MouseMove, QPoint(x,y), Qt::LeftButton, Qt::ShiftModifier);
 //     UMLWidget * temp = 0;
 //     //loop through list and move all widgets
 //     //don't move the widget that started call
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #566529:566530
@@ -75,7 +75,7 @@
 
     m_oldStatusBarMsg = UMLApp::app()->getStatusBarMsg();
 
-    if (me->state() == Qt::ShiftButton || me->state() == Qt::ControlButton) {
+    if (me->modifiers() == Qt::ShiftModifier || me->modifiers() == Qt::ControlModifier) {
         m_shiftPressed = true;
 
         if (me->button() == Qt::LeftButton) {
@@ -142,10 +142,10 @@
     int diffX = positionDifference.x();
     int diffY = positionDifference.y();
 
-    if ((me->state() & Qt::ShiftButton) && (me->state() & Qt::ControlButton)) {
+    if ((me->modifiers() & Qt::ShiftModifier) && (me->modifiers() & Qt::ControlModifier)) {
         //Move in Y axis
         diffX = m_oldX - m_widget->getX();
-    } else if ((me->state() & Qt::ShiftButton) || (me->state() & Qt::ControlButton)) {
+    } else if ((me->modifiers() & Qt::ShiftModifier) || (me->modifiers() & Qt::ControlModifier)) {
         //Move in X axis
         diffY = m_oldY - m_widget->getY();
     }
@@ -261,7 +261,8 @@
     } else {
         //TODO Move to ToolbarState or a subclass of it?
         //TODO why this condition?
-        if (me->stateAfter() != Qt::ShiftButton || me->stateAfter() != Qt::ControlButton) {
+        if (me->modifiers() != Qt::ShiftModifier 
+            || me->modifiers() != Qt::ControlModifier) {
             m_widget->m_pView->setAssoc(m_widget);
         }
     }
@@ -393,10 +394,10 @@
     int newW = m_oldW + me->x() - m_widget->getX() - m_pressOffsetX;
     int newH = m_oldH + me->y() - m_widget->getY() - m_pressOffsetY;
 
-    if ((me->state() & Qt::ShiftButton) && (me->state() & Qt::ControlButton)) {
+    if ((me->modifiers() & Qt::ShiftModifier) && (me->modifiers() & Qt::ControlModifier)) {
         //Move in Y axis
         newW = m_oldW;
-    } else if ((me->state() & Qt::ShiftButton) || (me->state() & Qt::ControlButton)) {
+    } else if ((me->modifiers() & Qt::ShiftModifier) || (me->modifiers() & Qt::ControlModifier)) {
         //Move in X axis
         newH = m_oldH;
     }




More information about the umbrello-devel mailing list