diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-06-10 11:09:40 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-06-16 08:44:39 +0000 |
commit | d10b4ad5bfcafd328684130d7f2b33c526dc439a (patch) | |
tree | bf353f83174b54544355370f07f8f66d78de151d /tests/plugins/declarativetestplugin | |
parent | 2b101cabae9a00519e8d048e5add2abb6e8524cc (diff) | |
download | qtlocation-d10b4ad5bfcafd328684130d7f2b33c526dc439a.tar.gz |
Fix warning about registering test plugin without id
Fixes warning 'Module 'QtLocation.test' does not
contain a module identifier directive - it cannot be
protected from external registrations.'
Add proper plugin description to qmldir, use proper plugin
naming convention QtLocation.Test
Change-Id: I67b24e2f82c6d07ec577b9cf477f9a581af65fe6
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests/plugins/declarativetestplugin')
-rw-r--r-- | tests/plugins/declarativetestplugin/declarativetestplugin.pro | 4 | ||||
-rw-r--r-- | tests/plugins/declarativetestplugin/locationtest.cpp | 14 | ||||
-rw-r--r-- | tests/plugins/declarativetestplugin/qmldir | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/plugins/declarativetestplugin/declarativetestplugin.pro b/tests/plugins/declarativetestplugin/declarativetestplugin.pro index c4c82e2e..a27267d7 100644 --- a/tests/plugins/declarativetestplugin/declarativetestplugin.pro +++ b/tests/plugins/declarativetestplugin/declarativetestplugin.pro @@ -1,6 +1,6 @@ CXX_MODULE = location TARGET = declarative_location_test -TARGETPATH = QtLocation/test +TARGETPATH = QtLocation/Test QT += gui-private qml quick location testlib @@ -19,7 +19,7 @@ IMPORT_FILES = \ qmldir load(qml_plugin) -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + # must be after load(qml_plugin) include(../imports.pri) diff --git a/tests/plugins/declarativetestplugin/locationtest.cpp b/tests/plugins/declarativetestplugin/locationtest.cpp index a2864d12..cde1d97f 100644 --- a/tests/plugins/declarativetestplugin/locationtest.cpp +++ b/tests/plugins/declarativetestplugin/locationtest.cpp @@ -46,15 +46,13 @@ class QLocationDeclarativeTestModule: public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: - virtual void registerTypes(const char* uri) { - qDebug() << "registerTypes in new test plugin: " << uri; - if (QLatin1String(uri) == QLatin1String("QtLocation.test")) { - // This version numbering is not correct. It is just something to get going - // until the proper versioning scheme of QML plugins in Qt5 is agreed upon. - qmlRegisterType<QDeclarativePinchGenerator>(uri, 5, 0, "PinchGenerator"); - qmlRegisterType<QDeclarativeLocationTestModel>(uri, 5, 0, "TestModel"); + virtual void registerTypes(const char* uri) + { + if (QLatin1String(uri) == QLatin1String("QtLocation.Test")) { + qmlRegisterType<QDeclarativePinchGenerator>(uri, 5, 5, "PinchGenerator"); + qmlRegisterType<QDeclarativeLocationTestModel>(uri, 5, 5, "TestModel"); } else { - qDebug() << "Unsupported URI given to load location test QML plugin: " << QLatin1String(uri); + qWarning() << "Unsupported URI given to load location test QML plugin: " << QLatin1String(uri); } } }; diff --git a/tests/plugins/declarativetestplugin/qmldir b/tests/plugins/declarativetestplugin/qmldir index f35dd9c1..c2582ede 100644 --- a/tests/plugins/declarativetestplugin/qmldir +++ b/tests/plugins/declarativetestplugin/qmldir @@ -1 +1,3 @@ +module QtLocation.Test plugin declarative_location_test +classname QLocationDeclarativeTestModule |