summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativemousearea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index a0208ef..1533d55 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -557,6 +557,7 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
ungrabMouse();
setKeepMouseGrab(false);
}
+ d->doubleClick = false;
}
void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
@@ -565,14 +566,12 @@ void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
if (!d->absorb) {
QDeclarativeItem::mouseDoubleClickEvent(event);
} else {
+ d->doubleClick = true;
d->saveEvent(event);
QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false);
me.setAccepted(d->isDoubleClickConnected());
emit this->doubleClicked(&me);
- if (!me.isAccepted()) {
- // Only deliver the press event if we haven't accepted the double click.
- QDeclarativeItem::mouseDoubleClickEvent(event);
- }
+ QDeclarativeItem::mouseDoubleClickEvent(event);
}
}
@@ -841,7 +840,8 @@ bool QDeclarativeMouseArea::setPressed(bool p)
d->pressed = p;
QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, isclick, d->longPress);
if (d->pressed) {
- emit pressed(&me);
+ if (!d->doubleClick)
+ emit pressed(&me);
me.setX(d->lastPos.x());
me.setY(d->lastPos.y());
emit mousePositionChanged(&me);
@@ -849,7 +849,7 @@ bool QDeclarativeMouseArea::setPressed(bool p)
emit released(&me);
me.setX(d->lastPos.x());
me.setY(d->lastPos.y());
- if (isclick && !d->longPress)
+ if (isclick && !d->longPress && !d->doubleClick)
emit clicked(&me);
}