diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-22 03:57:46 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-07-22 03:57:46 (GMT) |
commit | 5dd0dfcd7a079065f99c6149c15b58e69f302729 (patch) | |
tree | bf9bf2f202cdf5fdd5d4b52931036c8bc458569c /src/declarative/graphicsitems/qdeclarativemousearea_p.h | |
parent | 91215b48022b3b3980960f1b5f301ac84f14d49d (diff) | |
download | Qt-5dd0dfcd7a079065f99c6149c15b58e69f302729.zip Qt-5dd0dfcd7a079065f99c6149c15b58e69f302729.tar.gz Qt-5dd0dfcd7a079065f99c6149c15b58e69f302729.tar.bz2 |
Allow MouseArea dragging to filter mouse events from descendants
This allows dragging a MouseArea that contains a clickable MouseArea,
for example.
Task-number: QTBUG-12323
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativemousearea_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea_p.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 4fe3fcb..0da7515 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -62,6 +62,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeDrag : public QObject Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged) Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged) Q_PROPERTY(bool active READ active NOTIFY activeChanged) + Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged) //### consider drag and drop public: @@ -88,6 +89,9 @@ public: bool active() const; void setActive(bool); + bool filterChildren() const; + void setFilterChildren(bool); + Q_SIGNALS: void targetChanged(); void axisChanged(); @@ -96,6 +100,7 @@ Q_SIGNALS: void minimumYChanged(); void maximumYChanged(); void activeChanged(); + void filterChildrenChanged(); private: QGraphicsObject *_target; @@ -104,7 +109,8 @@ private: qreal _xmax; qreal _ymin; qreal _ymax; - bool _active; + bool _active : 1; + bool _filterChildren: 1; Q_DISABLE_COPY(QDeclarativeDrag) }; @@ -177,6 +183,8 @@ protected: void hoverMoveEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); bool sceneEvent(QEvent *); + bool sendMouseEvent(QGraphicsSceneMouseEvent *event); + bool sceneEventFilter(QGraphicsItem *i, QEvent *e); void timerEvent(QTimerEvent *event); virtual void geometryChanged(const QRectF &newGeometry, |