summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpolygon.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-05-12 16:50:24 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-05-18 08:55:16 +0000
commitc25bce109ef4a2a1fa1bfd7ecd6aba871546dbff (patch)
tree31c2ad89f4cf6ebf5f9fe469cfc0ae173d2765c9 /src/gui/painting/qpolygon.h
parentacc134c8ea5f756dd605d0de50ca1a263383de2d (diff)
Add QPolygon::intersects() methods
Corresponds to the similar function QPainterPath::intersects() and is faster than calculating the intersection and then checking if it is empty. Change-Id: I694bb2206ed330a456a41d4118a952a68177b7a2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qpolygon.h')
-rw-r--r--src/gui/painting/qpolygon.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index f192e8d10b..8e74a499fd 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -98,6 +98,8 @@ public:
Q_REQUIRED_RESULT QPolygon united(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon intersected(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon subtracted(const QPolygon &r) const;
+
+ bool intersects(const QPolygon &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon)
@@ -175,6 +177,8 @@ public:
Q_REQUIRED_RESULT QPolygonF united(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF intersected(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF subtracted(const QPolygonF &r) const;
+
+ bool intersects(const QPolygonF &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF)