aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-03-08 13:27:55 +0100
committerTarja Sundqvist <tarja.sundqvist@qt.io>2021-04-17 15:14:18 +0000
commitfdebe9afad9341b5804e118fb2f7f24ad78f2b3d (patch)
tree36dbbc24f85c9adf4c6d6019e7ffea58dd661a4e
parentb7f46486acb148acb45be3d20e827dbbeadb6547 (diff)
doc: fix up QQuickItem::contains() docs
- \c true and \c false - indentation - mention containmentMask() - overwritten -> overridden - hit-testing is for all pointing devices, not just the mouse Pick-to: 6.1 Change-Id: I1debe1f0b3a4f729225c462b20dd10bc4e1cf8b0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 66a0a93c0acf53d4e050066c1c480c66cd635f15) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/quick/items/qquickitem.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index f144f3ec5d..0ec28b843a 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -7812,22 +7812,23 @@ void QQuickItem::setKeepTouchGrab(bool keep)
}
/*!
- \qmlmethod bool QtQuick::Item::contains(point point)
+ \qmlmethod bool QtQuick::Item::contains(point point)
- Returns true if this item contains \a point, which is in local coordinates;
- returns false otherwise.
- */
+ Returns \c true if this item contains \a point, which is in local coordinates;
+ returns \c false otherwise. This is the same check that is used for
+ hit-testing a QEventPoint during event delivery, and is affected by
+ containmentMask() if it is set.
+*/
/*!
- Returns true if this item contains \a point, which is in local coordinates;
- returns false otherwise.
+ Returns \c true if this item contains \a point, which is in local coordinates;
+ returns \c false otherwise.
- This function can be overwritten in order to handle point collisions in items
- with custom shapes. The default implementation checks if the point is inside
- the item's bounding rect.
+ This function can be overridden in order to handle point collisions in items
+ with custom shapes. The default implementation checks whether the point is inside
+ containmentMask() if it is set, or inside the bounding box otherwise.
- Note that this method is generally used to check whether the item is under the mouse cursor,
- and for that reason, the implementation of this function should be as light-weight
- as possible.
+ \note This method is used for hit-testing each QEventPoint during event
+ delivery, so the implementation should be kept as lightweight as possible.
*/
bool QQuickItem::contains(const QPointF &point) const
{