summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2020-04-02 14:41:39 +0200
committerAlex Blasche <alexander.blasche@qt.io>2020-04-02 16:46:27 +0200
commit7711e7bcfae2c09688ecdaf587d580077889cce3 (patch)
treeae5de7fa93c39a5a9c6bd49e7b7de98a3863ce5d
parent05659943df25a4ab6edcbfc8ebaa6bc23a2eb72f (diff)
downloadqtlocation-7711e7bcfae2c09688ecdaf587d580077889cce3.tar.gz
Make use of qRegisterAnonymousType where possible
Conincidentally the patch fixes a few other minor deprecation warnings in the same file too. Change-Id: Iaf6221cd35cca95415b7d5383477b8c2bcfe92b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/imports/locationlabs/locationlabs.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/locationlabs/locationlabs.cpp b/src/imports/locationlabs/locationlabs.cpp
index 09fba284..4c039967 100644
--- a/src/imports/locationlabs/locationlabs.cpp
+++ b/src/imports/locationlabs/locationlabs.cpp
@@ -52,8 +52,8 @@ QT_BEGIN_NAMESPACE
static QObject *singleton_type_factory(QQmlEngine *engine, QJSEngine *jsEngine)
{
- Q_UNUSED(engine);
- Q_UNUSED(jsEngine);
+ Q_UNUSED(engine)
+ Q_UNUSED(jsEngine)
return new LocationLabsSingleton;
}
@@ -66,7 +66,7 @@ class QtLocationLabsDeclarativeModule: public QQmlExtensionPlugin
FILE "plugin.json")
public:
- QtLocationLabsDeclarativeModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { }
+ QtLocationLabsDeclarativeModule(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { }
virtual void registerTypes(const char *uri)
{
if (QLatin1String(uri) == QLatin1String("Qt.labs.location")) {
@@ -82,9 +82,9 @@ public:
qmlRegisterType<QMapCircleObject>(uri, major, minor, "MapCircleObject");
qmlRegisterType<QMapPolygonObject>(uri, major, minor, "MapPolygonObject");
qmlRegisterType<QMapPolylineObject>(uri, major, minor, "MapPolylineObject");
- qmlRegisterType<QDeclarativeNavigationBasicDirections>();
+ qmlRegisterAnonymousType<QDeclarativeNavigationBasicDirections>(uri, major);
qmlRegisterType<QDeclarativeNavigator>(uri, major, minor, "Navigator");
- qmlRegisterType<QAbstractNavigator>();
+ qmlRegisterAnonymousType<QAbstractNavigator>(uri, major);
qmlRegisterSingletonType<LocationLabsSingleton>(uri, major, minor, "QtLocationLabs", singleton_type_factory);
} else {
qDebug() << "Unsupported URI given to load location QML plugin: " << QLatin1String(uri);