aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-09-22 11:46:36 -0500
committerShawn Rutledge <shawn.rutledge@qt.io>2018-01-25 16:22:51 +0000
commitbf74a908cb0591c2adc024a6f93d566c7348c125 (patch)
tree71e749e71e8dcd4b159303526e7343dcd968e920 /src/quick/items/qquickitem_p.h
parentf6222f825831202c084835412a3c217a9420cad7 (diff)
Support masking of QQuickItems
Adding a new property, containsMask, to QQuickItem, that can be set to any QObject defining a Q_INVOKABLE bool contains(const QPointF &point). When this property is set, the mask object contains method is used in place of the item own contains method. [ChangeLog][QtQuick][QQuickItem] Added containsMask property. Task-number: QTBUG-20524 Change-Id: I5b0696e2cddc6ae3e217ce149c5f44980fdb69aa Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r--src/quick/items/qquickitem_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 9ed5286f22..0c02c66ef2 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -368,6 +368,9 @@ public:
QQuickDefaultClipNode *clipNode;
QSGRootNode *rootNode;
+ // Mask contains() method
+ QMetaMethod maskContains;
+
QObjectList resourcesList;
// Although acceptedMouseButtons is inside ExtraData, we actually store
@@ -382,6 +385,10 @@ public:
// 26 bits padding
};
QLazilyAllocated<ExtraData> extra;
+ // Contains mask
+ QPointer<QObject> mask;
+ // If the mask is an Item, inform it that it's being used as a mask (true) or is no longer being used (false)
+ virtual void registerAsContainsMask(QQuickItem * /* maskedItem */, bool /* set */) { }
QQuickAnchors *anchors() const;
mutable QQuickAnchors *_anchors;