[qet] [1657] Bugfix: arrow keys triggered both items movement and scroll area on diagrams.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1657
Author:   xavier
Date:     2012-04-16 08:33:26 +0200 (Mon, 16 Apr 2012)
Log Message:
-----------
Bugfix: arrow keys triggered both items movement and scroll area on diagrams.

Modified Paths:
--------------
    branches/0.3/sources/diagram.cpp

Modified: branches/0.3/sources/diagram.cpp
===================================================================
--- branches/0.3/sources/diagram.cpp	2012-04-15 18:54:04 UTC (rev 1656)
+++ branches/0.3/sources/diagram.cpp	2012-04-16 06:33:26 UTC (rev 1657)
@@ -161,9 +161,12 @@
 		if (!movement.isNull() && !focusItem()) {
 			beginMoveElements();
 			continueMoveElements(movement);
+			e -> accept();
 		}
 	}
-	QGraphicsScene::keyPressEvent(e);
+	if (!e -> isAccepted()) {
+		QGraphicsScene::keyPressEvent(e);
+	}
 }
 
 /**
@@ -179,9 +182,12 @@
 			!e -> isAutoRepeat()
 		) {
 			endMoveElements();
+			e->accept();
 		}
 	}
-	QGraphicsScene::keyReleaseEvent(e);
+	if (!e -> isAccepted()) {
+		QGraphicsScene::keyReleaseEvent(e);
+	}
 }
 
 /**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/