[qet] [1706] Fixed regression introduced in rev1657: key strokes were discarded when editing texts. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 1706
Author: xavier
Date: 2012-04-29 01:22:34 +0200 (Sun, 29 Apr 2012)
Log Message:
-----------
Fixed regression introduced in rev1657: key strokes were discarded when editing texts.
Modified Paths:
--------------
branches/0.3/sources/diagram.cpp
Modified: branches/0.3/sources/diagram.cpp
===================================================================
--- branches/0.3/sources/diagram.cpp 2012-04-28 22:06:25 UTC (rev 1705)
+++ branches/0.3/sources/diagram.cpp 2012-04-28 23:22:34 UTC (rev 1706)
@@ -150,6 +150,7 @@
@param e QKeyEvent decrivant l'evenement clavier
*/
void Diagram::keyPressEvent(QKeyEvent *e) {
+ bool transmit_event = true;
if (!isReadOnly()) {
QPointF movement;
switch(e -> key()) {
@@ -162,9 +163,10 @@
beginMoveElements();
continueMoveElements(movement);
e -> accept();
+ transmit_event = false;
}
}
- if (!e -> isAccepted()) {
+ if (transmit_event) {
QGraphicsScene::keyPressEvent(e);
}
}
@@ -174,6 +176,7 @@
@param e QKeyEvent decrivant l'evenement clavier
*/
void Diagram::keyReleaseEvent(QKeyEvent *e) {
+ bool transmit_event = true;
if (!isReadOnly()) {
// detecte le relachement d'une touche de direction ( = deplacement d'elements)
if (
@@ -182,10 +185,11 @@
!e -> isAutoRepeat()
) {
endMoveElements();
- e->accept();
+ e -> accept();
+ transmit_event = false;
}
}
- if (!e -> isAccepted()) {
+ if (transmit_event) {
QGraphicsScene::keyReleaseEvent(e);
}
}