diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-01-24 23:30:45 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2011-01-25 00:41:05 (GMT) |
commit | b36859acae472916c35ac31174c8230543d900ab (patch) | |
tree | c57eb42b3eb8be9d0c11df6dd0dacb30f7c72024 /src/declarative/graphicsitems/qdeclarativemousearea.cpp | |
parent | 4768e23056691ee14a91e1f2cf258e8f51847aaf (diff) | |
download | Qt-b36859acae472916c35ac31174c8230543d900ab.zip Qt-b36859acae472916c35ac31174c8230543d900ab.tar.gz Qt-b36859acae472916c35ac31174c8230543d900ab.tar.bz2 |
Notify that pressed has changed before calling the onClicked handler.
This is a more natural ordering, and makes it trivial to control
different state groups with pressed and onClicked.
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index ee6765c..273fc53 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -863,15 +863,16 @@ bool QDeclarativeMouseArea::setPressed(bool p) me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit mousePositionChanged(&me); + emit pressedChanged(); } else { emit released(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); + emit pressedChanged(); if (isclick && !d->longPress && !d->doubleClick) emit clicked(&me); } - emit pressedChanged(); return me.isAccepted(); } return false; |