From bf4761232edd938425cf70b140be8992e697bc5d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Aug 2016 17:31:20 +0200 Subject: Restore version 2.0 for the .impl imports It's a bit of extra hassle, but the type registration can be done so that we keep the old version available to avoid deliberately breaking apps that have had to import .impl to gain access to the internal goodies. For example, someone may have made a copy of one of the controls as our documentation suggests. :) Change-Id: I5308d7e74ecebf69da7fe9c6912380f72c3c9a2b Reviewed-by: Mitch Curtis --- .../qtquickcontrols2universalstyleplugin.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp') diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index aa0aea34..394e9162 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -77,7 +77,7 @@ QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObje void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri) { qmlRegisterUncreatableType(uri, 2, 0, "Universal", tr("Universal is an attached property")); - qmlRegisterUncreatableType(uri, 2, 1, "Universal", tr("Universal is an attached property")); + qmlRegisterRevision(uri, 2, 1); } void QtQuickControls2UniversalStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri) @@ -87,14 +87,15 @@ void QtQuickControls2UniversalStylePlugin::initializeEngine(QQmlEngine *engine, engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Universal/images"))); QByteArray import = QByteArray(uri) + ".impl"; - qmlRegisterType(import, 2, 1, "FocusRectangle"); - qmlRegisterType(import, 2, 1, "ProgressRing"); - qmlRegisterType(import, 2, 1, "ProgressRingAnimator"); - qmlRegisterType(import, 2, 1, "ProgressStrip"); - qmlRegisterType(import, 2, 1, "ProgressStripAnimator"); - - qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 1, "RadioIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 1, "SwitchIndicator"); + qmlRegisterType(import, 2, 0, "FocusRectangle"); + qmlRegisterRevision(import, 2, 1); + qmlRegisterType(import, 2, 0, "ProgressRing"); + qmlRegisterType(import, 2, 0, "ProgressRingAnimator"); + qmlRegisterType(import, 2, 0, "ProgressStrip"); + qmlRegisterType(import, 2, 0, "ProgressStripAnimator"); + + qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); + qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); } QString QtQuickControls2UniversalStylePlugin::name() const -- cgit v1.2.3