summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2020-12-23 12:45:12 +0100
committerIvan Solovev <ivan.solovev@qt.io>2021-01-20 14:10:38 +0100
commit89f1e45e487ca6ae3998699153b10c343aef25d9 (patch)
treec6df17375038777a134fba0251cd78630880e363 /tests
parentc50cf545fce1e4b61255c85fd8c261df6fe4d663 (diff)
downloadqtlocation-89f1e45e487ca6ae3998699153b10c343aef25d9.tar.gz
QtPositioning: adapt to Qt6
Make QtPositioning module buildable under Qt6: - remove calls to deleted QMetaType-registration methods - replace int -> qsizetype where it prevents the code from being compiled - fix some deprecation warnings - fix library dependencies in .pro file for building tests - fix weatherinfo example For now only qmake is supported. CMake support will be done in scope of a separate patch. Geoflickr example is yet to be ported, as it requires extracting XmlListModel from xmlpatterns. QtLocation is also skipped for now, as it seems to require heavy refactoring due to changes in QSGMaterialShader interface. QtLocation build is disabled in qmake for now. Task-number: QTBUG-89853 Change-Id: I8cc4da6efabe32ce114701219d5431f8480bee3b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro11
-rw-r--r--tests/auto/positionplugin/plugin.cpp33
-rw-r--r--tests/auto/positionpluginV1/plugin.cpp22
-rw-r--r--tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp1
4 files changed, 34 insertions, 33 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 390e9135..d26711c3 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -37,8 +37,7 @@ qtHaveModule(location) {
qplacemanager.depends = geotestplugin
}
- #misc tests
- SUBDIRS += doublevectors
+ #qml interface tests
!android: SUBDIRS += cmake qmlinterface # looks for .qmls locally
#Map and Navigation tests
@@ -56,7 +55,8 @@ qtHaveModule(location) {
qgeotilespec \
qgeoroutexmlparser \
maptype \
- qgeocameratiles
+ qgeocameratiles \
+ qgeojson
# These use plugins
!android: {
@@ -81,8 +81,8 @@ qtHaveModule(location) {
}
}
-
SUBDIRS += \
+ doublevectors \
qgeoaddress \
qgeoshape \
qgeorectangle \
@@ -92,8 +92,7 @@ SUBDIRS += \
qgeocoordinate \
qgeolocation \
qgeopositioninfo \
- qgeosatelliteinfo \
- qgeojson
+ qgeosatelliteinfo
!android: SUBDIRS += \
positionplugin \
diff --git a/tests/auto/positionplugin/plugin.cpp b/tests/auto/positionplugin/plugin.cpp
index 82bc4411..fd8f931d 100644
--- a/tests/auto/positionplugin/plugin.cpp
+++ b/tests/auto/positionplugin/plugin.cpp
@@ -43,16 +43,16 @@ public:
DummySource(const QVariantMap &parameters, QObject *parent=0);
~DummySource();
- void startUpdates();
- void stopUpdates();
- void requestUpdate(int timeout=5000);
+ void startUpdates() override;
+ void stopUpdates() override;
+ void requestUpdate(int timeout = 5000) override;
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const;
- PositioningMethods supportedPositioningMethods() const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const override;
+ PositioningMethods supportedPositioningMethods() const override;
- void setUpdateInterval(int msec);
- int minimumUpdateInterval() const;
- Error error() const;
+ void setUpdateInterval(int msec) override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
private:
QTimer *timer;
@@ -219,13 +219,16 @@ class QGeoPositionInfoSourceFactoryTest : public QObject, public QGeoPositionInf
Q_INTERFACES(QGeoPositionInfoSourceFactoryV2)
public:
- QGeoPositionInfoSource *positionInfoSource(QObject *parent);
- QGeoSatelliteInfoSource *satelliteInfoSource(QObject *parent);
- QGeoAreaMonitorSource *areaMonitor(QObject *parent);
-
- QGeoPositionInfoSource *positionInfoSourceWithParameters(QObject *parent, const QVariantMap &parameters);
- QGeoSatelliteInfoSource *satelliteInfoSourceWithParameters(QObject *parent, const QVariantMap &parameters);
- QGeoAreaMonitorSource *areaMonitorWithParameters(QObject *parent, const QVariantMap &parameters);
+ QGeoPositionInfoSource *positionInfoSource(QObject *parent) override;
+ QGeoSatelliteInfoSource *satelliteInfoSource(QObject *parent) override;
+ QGeoAreaMonitorSource *areaMonitor(QObject *parent) override;
+
+ QGeoPositionInfoSource *positionInfoSourceWithParameters(QObject *parent,
+ const QVariantMap &parameters) override;
+ QGeoSatelliteInfoSource *satelliteInfoSourceWithParameters(QObject *parent,
+ const QVariantMap &parameters) override;
+ QGeoAreaMonitorSource *areaMonitorWithParameters(QObject *parent,
+ const QVariantMap &parameters) override;
};
QGeoPositionInfoSource *QGeoPositionInfoSourceFactoryTest::positionInfoSource(QObject *parent)
diff --git a/tests/auto/positionpluginV1/plugin.cpp b/tests/auto/positionpluginV1/plugin.cpp
index bf8b8234..f3d0165e 100644
--- a/tests/auto/positionpluginV1/plugin.cpp
+++ b/tests/auto/positionpluginV1/plugin.cpp
@@ -42,16 +42,16 @@ public:
DummySource(QObject *parent = nullptr);
~DummySource();
- void startUpdates();
- void stopUpdates();
- void requestUpdate(int timeout=5000);
+ void startUpdates() override;
+ void stopUpdates() override;
+ void requestUpdate(int timeout = 5000) override;
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const;
- PositioningMethods supportedPositioningMethods() const;
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const override;
+ PositioningMethods supportedPositioningMethods() const override;
- void setUpdateInterval(int msec);
- int minimumUpdateInterval() const;
- Error error() const;
+ void setUpdateInterval(int msec) override;
+ int minimumUpdateInterval() const override;
+ Error error() const override;
private:
QTimer *timer;
@@ -187,9 +187,9 @@ class QGeoPositionInfoSourceFactoryTestV1 : public QObject, public QGeoPositionI
Q_INTERFACES(QGeoPositionInfoSourceFactory)
public:
- QGeoPositionInfoSource *positionInfoSource(QObject *parent);
- QGeoSatelliteInfoSource *satelliteInfoSource(QObject *parent);
- QGeoAreaMonitorSource *areaMonitor(QObject *parent);
+ QGeoPositionInfoSource *positionInfoSource(QObject *parent) override;
+ QGeoSatelliteInfoSource *satelliteInfoSource(QObject *parent) override;
+ QGeoAreaMonitorSource *areaMonitor(QObject *parent) override;
};
QGeoPositionInfoSource *QGeoPositionInfoSourceFactoryTestV1::positionInfoSource(QObject *parent)
diff --git a/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp b/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
index 1b30f647..368ea774 100644
--- a/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
+++ b/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
@@ -82,7 +82,6 @@ private slots:
void initTestcase()
{
qRegisterMetaType<QGeoCoordinate>();
- QMetaType::registerEqualsComparator<QGeoCoordinate>();
}
void constructor()