summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativemousearea.cpp
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-09-15 17:21:39 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-09-15 17:21:39 (GMT)
commitf23bce37a8a3536bfedce7cc2d57f0761b2d1e31 (patch)
treee7dd9c7f7724df3f12fe819321e44c63f4eb0c2c /src/declarative/graphicsitems/qdeclarativemousearea.cpp
parentf41eac269d354ebeb797b9cb173b09fc996564cf (diff)
parentb832dffc1eb85181aa2d99afd1a6c764b634091d (diff)
downloadQt-f23bce37a8a3536bfedce7cc2d57f0761b2d1e31.zip
Qt-f23bce37a8a3536bfedce7cc2d57f0761b2d1e31.tar.gz
Qt-f23bce37a8a3536bfedce7cc2d57f0761b2d1e31.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 666f5e1..a0208ef 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -333,7 +333,9 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
position of the release of the click, and whether the click was held.
- The \e accepted property of the MouseEvent parameter is ignored in this handler.
+ If the \e accepted property of the \l {MouseEvent}{mouse} parameter is set to false
+ in the handler, the onPressed/onReleased/onClicked handlers will be called for the second
+ click; otherwise they are supressed. The accepted property defaults to true.
*/
/*!
@@ -563,12 +565,13 @@ void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
if (!d->absorb) {
QDeclarativeItem::mouseDoubleClickEvent(event);
} else {
- QDeclarativeItem::mouseDoubleClickEvent(event);
- if (event->isAccepted()) {
- // Only deliver the event if we have accepted the press.
- d->saveEvent(event);
- QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false);
- emit this->doubleClicked(&me);
+ 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);
}
}
}