summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-10-16 09:18:02 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-10-22 11:00:46 +0000
commitba53384387dcfd2606a513b114eff488d3fdb940 (patch)
tree3dd050fde58eb56cec2d335151ac31ffad6b4ed9
parent4a328e3533f93ed65f9dc77f764b3cbe3c694266 (diff)
downloadqtwayland-ba53384387dcfd2606a513b114eff488d3fdb940.tar.gz
Compositor: Add const version of QWaylandQuickItem::inputRegionContains
Change-Id: I649149e2cee24f8296bf24a22ee8bb865feea9c6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp12
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index fd9b1b80..a5de3a90 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -1036,13 +1036,23 @@ void QWaylandQuickItem::setFocusOnClick(bool focus)
* Returns \c true if the input region of this item's surface contains the
* position given by \a localPosition.
*/
-bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition)
+bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition) const
{
if (QWaylandSurface *s = surface())
return s->inputRegionContains(mapToSurface(localPosition).toPoint());
return false;
}
+// Qt 6: Remove the non-const version
+/*!
+ * Returns \c true if the input region of this item's surface contains the
+ * position given by \a localPosition.
+ */
+bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition)
+{
+ return const_cast<const QWaylandQuickItem *>(this)->inputRegionContains(localPosition);
+}
+
/*!
* Maps the given \a point in this item's coordinate system to the equivalent
* point within the Wayland surface's coordinate system, and returns the mapped
diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h
index 653440ae..23708353 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.h
+++ b/src/compositor/compositor_api/qwaylandquickitem.h
@@ -99,6 +99,7 @@ public:
bool focusOnClick() const;
void setFocusOnClick(bool focus);
+ bool inputRegionContains(const QPointF &localPosition) const;
bool inputRegionContains(const QPointF &localPosition);
Q_INVOKABLE QPointF mapToSurface(const QPointF &point) const;