From d28c9f6abb7311f75a182309ad2b3e875fd6ba59 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 20 Oct 2016 17:16:01 +0200 Subject: Make sure the appropriate import versions are always available Utilize the newly introduced qmlRegisterModule() to automatically register the import version that matches the Qt version that is used to build the module. Now we can remove the artificial qmlRegisterRevision() calls, which were added just to make certain import versions available, even if there was no such revision. Change-Id: Ic3887c221c69b6cd299853d8d5869b8af7a314ec Reviewed-by: Mitch Curtis --- .../controls/material/qtquickcontrols2materialstyleplugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/imports/controls/material') diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index 36335cf1..8a18c979 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -78,8 +78,8 @@ QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) { + qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... qmlRegisterUncreatableType(uri, 2, 0, "Material", tr("Material is an attached property")); - qmlRegisterRevision(uri, 2, 1); } void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri) @@ -89,8 +89,9 @@ void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, c engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Material/images"))); QByteArray import = QByteArray(uri) + ".impl"; + qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... + qmlRegisterType(import, 2, 0, "PaddedRectangle"); - qmlRegisterRevision(import, 2, 1); qmlRegisterType(import, 2, 0, "BusyIndicatorImpl"); qmlRegisterType(import, 2, 0, "ProgressBarImpl"); qmlRegisterType(import, 2, 0, "Ripple"); -- cgit v1.2.3