diff options
author | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2010-04-16 06:50:27 (GMT) |
---|---|---|
committer | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2010-04-19 00:20:18 (GMT) |
commit | 5efb732bc78e15605ac9d9f770e1bd24c01bb778 (patch) | |
tree | 952639777368bcdfd444415d9890cf1403d0ec3b /src/declarative/graphicsitems/qdeclarativemousearea_p.h | |
parent | 465f4df8ad4be9485c37ecc379c45e758b2842ad (diff) | |
download | Qt-5efb732bc78e15605ac9d9f770e1bd24c01bb778.zip Qt-5efb732bc78e15605ac9d9f770e1bd24c01bb778.tar.gz Qt-5efb732bc78e15605ac9d9f770e1bd24c01bb778.tar.bz2 |
Update mouse area coordinates automatically when changing position
Mouse area coordinates are now updated when the mouse area changes position
and positionChanged signals are not emitted on mousePress anymore (only
mousePosChanged signals).
Task-number: QTBUG-9716
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea_p.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 58faac1..cfd5fc7 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -108,8 +108,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeMouseArea : public QDeclarativeItem { Q_OBJECT - Q_PROPERTY(qreal mouseX READ mouseX NOTIFY positionChanged) - Q_PROPERTY(qreal mouseY READ mouseY NOTIFY positionChanged) + Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mousePosChanged) + Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mousePosChanged) Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged) Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) @@ -144,6 +144,7 @@ Q_SIGNALS: void enabledChanged(); void acceptedButtonsChanged(); void positionChanged(QDeclarativeMouseEvent *mouse); + void mousePosChanged(QDeclarativeMouseEvent *mouse); void pressed(QDeclarativeMouseEvent *mouse); void pressAndHold(QDeclarativeMouseEvent *mouse); @@ -167,6 +168,9 @@ protected: bool sceneEvent(QEvent *); void timerEvent(QTimerEvent *event); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + private: void handlePress(); void handleRelease(); |