summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-01-24 06:05:17 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-01-25 00:41:04 (GMT)
commit4768e23056691ee14a91e1f2cf258e8f51847aaf (patch)
treeeb85a67eb0b7be895c0c84b61efa124c7bd56ed4
parent1aea31ebfdd9a6893b2d88b69f34de0b1456b2e4 (diff)
downloadQt-4768e23056691ee14a91e1f2cf258e8f51847aaf.zip
Qt-4768e23056691ee14a91e1f2cf258e8f51847aaf.tar.gz
Qt-4768e23056691ee14a91e1f2cf258e8f51847aaf.tar.bz2
Improve information reported for MouseArea hover events.
Reviewed-by: Martin Jones
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 82125f7..ee6765c 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -583,8 +583,12 @@ void QDeclarativeMouseArea::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Q_D(QDeclarativeMouseArea);
if (!d->absorb)
QDeclarativeItem::hoverEnterEvent(event);
- else
+ else {
+ d->lastPos = event->pos();
setHovered(true);
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, event->modifiers(), false, false);
+ emit mousePositionChanged(&me);
+ }
}
void QDeclarativeMouseArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
@@ -594,7 +598,7 @@ void QDeclarativeMouseArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
QDeclarativeItem::hoverMoveEvent(event);
} else {
d->lastPos = event->pos();
- QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, d->lastButtons, d->lastModifiers, false, d->longPress);
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, event->modifiers(), false, false);
emit mousePositionChanged(&me);
me.setX(d->lastPos.x());
me.setY(d->lastPos.y());