From baff6ac17d6ab581460dbdf1f2b6706e56e38b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 19 Feb 2025 00:44:36 +0100 Subject: [PATCH] Remove all Qt5 < 5.15 workarounds. Qt 5.15 is now the minimal required Qt version. --- .github/workflows/linux.yml | 7 +++++-- README.md | 2 +- src/textpathitem.cpp | 23 ++++++++--------------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9bd84f6..8f5ac8b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,7 +8,10 @@ on: jobs: build: name: QtPBFImagePlugin - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + strategy: + matrix: + config: ['release', 'debug'] steps: - name: Checkout uses: actions/checkout@v4 @@ -17,6 +20,6 @@ jobs: sudo apt-get update sudo apt-get install qtbase5-dev qtbase5-dev-tools qt5-qmake zlib1g-dev - name: Configure build - run: qmake pbfplugin.pro + run: qmake CONFIG+=${{ matrix.config }} pbfplugin.pro - name: Build project run: make -j2 diff --git a/README.md b/README.md index 6a44d6d..6793aff 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ repository. ## Build ### Requirements -* Qt5 >= 5.11 or Qt6 +* Qt5 >= 5.15 or Qt6 * Zlib ### Build steps diff --git a/src/textpathitem.cpp b/src/textpathitem.cpp index 0fa0406..c9a1073 100644 --- a/src/textpathitem.cpp +++ b/src/textpathitem.cpp @@ -2,13 +2,6 @@ #include #include "textpathitem.h" - -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) -#define INTERSECTS intersect -#else // QT 5.15 -#define INTERSECTS intersects -#endif // QT 5.15 - static void swap(const QLineF &line, QPointF *p1, QPointF *p2) { @@ -30,10 +23,10 @@ static bool intersection(const QLineF &line, const QRectF &rect, QPointF *p1, { QPointF *p = p1; - if (line.INTERSECTS(QLineF(rect.topLeft(), rect.topRight()), p) + if (line.intersects(QLineF(rect.topLeft(), rect.topRight()), p) == QLineF::BoundedIntersection) p = p2; - if (line.INTERSECTS(QLineF(rect.topLeft(), rect.bottomLeft()), p) + if (line.intersects(QLineF(rect.topLeft(), rect.bottomLeft()), p) == QLineF::BoundedIntersection) { if (p == p2) { swap(line, p1, p2); @@ -41,7 +34,7 @@ static bool intersection(const QLineF &line, const QRectF &rect, QPointF *p1, } p = p2; } - if (line.INTERSECTS(QLineF(rect.bottomRight(), rect.bottomLeft()), p) + if (line.intersects(QLineF(rect.bottomRight(), rect.bottomLeft()), p) == QLineF::BoundedIntersection) { if (p == p2) { swap(line, p1, p2); @@ -49,7 +42,7 @@ static bool intersection(const QLineF &line, const QRectF &rect, QPointF *p1, } p = p2; } - if (line.INTERSECTS(QLineF(rect.bottomRight(), rect.topRight()), p) + if (line.intersects(QLineF(rect.bottomRight(), rect.topRight()), p) == QLineF::BoundedIntersection) { if (p == p2) { swap(line, p1, p2); @@ -64,16 +57,16 @@ static bool intersection(const QLineF &line, const QRectF &rect, QPointF *p1, static bool intersection(const QLineF &line, const QRectF &rect, QPointF *p) { - if (line.INTERSECTS(QLineF(rect.topLeft(), rect.topRight()), p) + if (line.intersects(QLineF(rect.topLeft(), rect.topRight()), p) == QLineF::BoundedIntersection) return true; - if (line.INTERSECTS(QLineF(rect.topLeft(), rect.bottomLeft()), p) + if (line.intersects(QLineF(rect.topLeft(), rect.bottomLeft()), p) == QLineF::BoundedIntersection) return true; - if (line.INTERSECTS(QLineF(rect.bottomRight(), rect.bottomLeft()), p) + if (line.intersects(QLineF(rect.bottomRight(), rect.bottomLeft()), p) == QLineF::BoundedIntersection) return true; - if (line.INTERSECTS(QLineF(rect.bottomRight(), rect.topRight()), p) + if (line.intersects(QLineF(rect.bottomRight(), rect.topRight()), p) == QLineF::BoundedIntersection) return true;