Skip to content

Commit

Permalink
Fix the build with Qt 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadej committed Oct 14, 2023
1 parent acd5e87 commit 5062dd3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/Linux-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
qt_version: 6.5.3
qt_modules: qtlocation qtpositioning
compiler: gcc-13
- qt_series: 6
qt_version: 6.6.0
qt_modules: qtlocation qtpositioning
compiler: gcc-13

steps:
- name: Checkout
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- qt_series: 6
qt_version: 6.5.3
qt_modules: qtlocation qtpositioning
- qt_series: 6
qt_version: 6.6.0
qt_modules: qtlocation qtpositioning

steps:
- name: Checkout
Expand Down Expand Up @@ -103,7 +106,7 @@ jobs:
contents: write
strategy:
matrix:
qt_version: [5.15.2, 6.5.3]
qt_version: [5.15.2, 6.5.3, 6.6.0]

steps:
- name: Download artifacts
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- qt_series: 6
qt_version: 6.5.3
qt_modules: qtlocation qtpositioning
- qt_series: 6
qt_version: 6.6.0
qt_modules: qtlocation qtpositioning

steps:
- name: Checkout
Expand Down Expand Up @@ -183,7 +186,7 @@ jobs:
contents: write
strategy:
matrix:
qt_version: [5.15.2, 6.5.3]
qt_version: [5.15.2, 6.5.3, 6.6.0]

steps:
- name: Download artifacts
Expand Down
9 changes: 7 additions & 2 deletions src/location/stylechange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,20 @@ QMapLibre::Feature featureFromMapCircle(QDeclarativeCircleMapItem *mapItem) {
path, mapItem->center(), mapItem->radius(), circleSamples, leftBound);
#endif
QList<QDoubleVector2D> pathProjected;
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QDeclarativeCircleMapItemPrivate::calculatePeripheralPoints(
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
QDeclarativeCircleMapItemPrivate::calculatePeripheralPointsSimple(
pathProjected, mapItem->center(), mapItem->radius(), p, circleSamples);
// TODO: Removed for now. Update when the 6.6 API for this is fixed
// if (QDeclarativeCircleMapItemPrivateCPU::crossEarthPole(mapItem->center(), mapItem->radius()))
// QDeclarativeCircleMapItemPrivateCPU::preserveCircleGeometry(pathProjected, mapItem->center(),
// mapItem->radius(), p);
QList<QGeoCoordinate> path;
for (const QDoubleVector2D &c : std::as_const(pathProjected)) path << p.mapProjectionToGeo(c);
#elif QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QDeclarativeCircleMapItemPrivate::calculatePeripheralPoints(
pathProjected, mapItem->center(), mapItem->radius(), p, circleSamples);
QList<QGeoCoordinate> path;
for (const QDoubleVector2D &c : std::as_const(pathProjected)) path << p.mapProjectionToGeo(c);
#else
for (const QGeoCoordinate &c : qAsConst(path)) pathProjected << p.geoToMapProjection(c);
if (QDeclarativeCircleMapItemPrivateCPU::crossEarthPole(mapItem->center(), mapItem->radius()))
Expand Down

0 comments on commit 5062dd3

Please sign in to comment.