From 7711e7bcfae2c09688ecdaf587d580077889cce3 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 2 Apr 2020 14:41:39 +0200 Subject: 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 --- src/imports/locationlabs/locationlabs.cpp | 10 +++++----- 1 file 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(uri, major, minor, "MapCircleObject"); qmlRegisterType(uri, major, minor, "MapPolygonObject"); qmlRegisterType(uri, major, minor, "MapPolylineObject"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, major); qmlRegisterType(uri, major, minor, "Navigator"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, major); qmlRegisterSingletonType(uri, major, minor, "QtLocationLabs", singleton_type_factory); } else { qDebug() << "Unsupported URI given to load location QML plugin: " << QLatin1String(uri); -- cgit v1.2.1