[Kst] branches/work/kst/portto4/kst/src/libkstapp

Nicolas Brisset nicolas.brisset at eurocopter.com
Thu Jun 30 23:23:19 CEST 2011


SVN commit 1238888 by brisset:

Open the edit plot dialog with double click to be consistent with other similar actions. It still opens in the right tab according to where the user 
clicks.
Thanks Peter for your hint :-) I hope it does not have side effects on something else. I've tested a little bit and it seems fine. If there are 
issues or someone brings good arguments against the change, we can easily revert this commit.


 M  +10 -3     plotitem.cpp  
 M  +1 -0      plotitem.h  


--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1238887:1238888
@@ -2757,7 +2757,15 @@
     if (checkBox().contains(event->pos())) {
       setTiedZoom(!isTiedZoom(), !isTiedZoom());
       ViewItem::mousePressEvent(event);
-    } else if (view()->viewMode() == View::Data) {
+    } else {
+      ViewItem::mousePressEvent(event);
+    }
+  } 
+}
+
+
+void PlotItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
+  if (event->button() == Qt::LeftButton && view()->viewMode() == View::Data) {
       PlotClickEditRegion region = CONTENT;
       if (event->pos().x() - rect().left() < leftLabelMargin()) {
         region = LABEL;
@@ -2774,10 +2782,9 @@
       }
       edit(region);
     } else {
-      ViewItem::mousePressEvent(event);
+    ViewItem::mouseDoubleClickEvent(event);
     }
   } 
-}
 
 
 QPainterPath PlotItem::checkBox() const {
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.h #1238887:1238888
@@ -283,6 +283,7 @@
     virtual void _initializeShortName();
 
     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
     virtual void updateChildGeometry(const QRectF &oldParentRect, const QRectF &newParentRect);
 
   Q_SIGNALS:


More information about the Kst mailing list