diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-01-24 06:05:17 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2011-01-25 00:41:04 (GMT) |
commit | 4768e23056691ee14a91e1f2cf258e8f51847aaf (patch) | |
tree | eb85a67eb0b7be895c0c84b61efa124c7bd56ed4 /src/declarative | |
parent | 1aea31ebfdd9a6893b2d88b69f34de0b1456b2e4 (diff) | |
download | Qt-4768e23056691ee14a91e1f2cf258e8f51847aaf.zip Qt-4768e23056691ee14a91e1f2cf258e8f51847aaf.tar.gz Qt-4768e23056691ee14a91e1f2cf258e8f51847aaf.tar.bz2 |
Improve information reported for MouseArea hover events.
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea.cpp | 8 |
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()); |