summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativemousearea.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-01-24 23:30:45 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-01-25 00:41:05 (GMT)
commitb36859acae472916c35ac31174c8230543d900ab (patch)
treec57eb42b3eb8be9d0c11df6dd0dacb30f7c72024 /src/declarative/graphicsitems/qdeclarativemousearea.cpp
parent4768e23056691ee14a91e1f2cf258e8f51847aaf (diff)
downloadQt-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.cpp3
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;