diff options
author | Liang Qi <liang.qi@qt.io> | 2019-01-10 16:47:26 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-01-10 16:47:26 +0100 |
commit | efa04c2ae8427c70848477ace3d8f6e82baaab11 (patch) | |
tree | c0394c9cd5ce51961337a7a15e169074dd41632b /src/imports/controls/qtquickcontrols2plugin.cpp | |
parent | 9c7429219d36e8eb40e1fe6e679715c89209fc40 (diff) | |
parent | 6476de0b669162cf08c11f5c8d5ad0b42419f365 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
.qmake.conf
src/imports/controls/qtquickcontrols2plugin.cpp
Change-Id: I27f1260b539354e084beb28be78385e57fda63e1
Diffstat (limited to 'src/imports/controls/qtquickcontrols2plugin.cpp')
-rw-r--r-- | src/imports/controls/qtquickcontrols2plugin.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 0dd787b4..133be0d1 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -120,7 +120,13 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) stylePlugin->initializeTheme(theme); qDeleteAll(stylePlugins); - qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... + // Register the latest version, even if there are no new types or new revisions for existing types yet. + // Before Qt 5.12, we would do the following: + // + // qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... + // + // However, we want to align with the rest of Qt Quick which uses Qt's minor version. + qmlRegisterModule(uri, 2, QT_VERSION_MINOR); // QtQuick.Controls 2.0 (originally introduced in Qt 5.7) qmlRegisterType(resolvedUrl(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton"); @@ -192,8 +198,14 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) qmlRegisterUncreatableType<QQuickSplitHandleAttached>(uri, 2, 5, "SplitHandle", QStringLiteral("SplitHandle is only available as an attached property.")); + // Register the latest version, even if there are no new types or new revisions for existing types yet. + // Before Qt 5.12, we would do the following: + // + // qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... + // + // However, we want to align with the rest of Qt Quick which uses Qt's minor version. const 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... + qmlRegisterModule(import, 2, QT_VERSION_MINOR); // QtQuick.Controls.impl 2.0 (Qt 5.7) qmlRegisterType<QQuickDefaultBusyIndicator>(import, 2, 0, "BusyIndicatorImpl"); @@ -272,6 +284,10 @@ QList<QQuickStylePlugin *> QtQuickControls2Plugin::loadStylePlugins() // release versions of the same Qt libraries (due to the plugin's dependencies). filePath += QStringLiteral("_debug"); #endif // Q_OS_MACOS && QT_DEBUG +#if defined(Q_OS_WIN) && defined(QT_DEBUG) + // Debug versions of plugins have a "d" prefix on Windows. + filePath += QLatin1Char('d'); +#endif // Q_OS_WIN && QT_DEBUG loader.setFileName(filePath); QQuickStylePlugin *stylePlugin = qobject_cast<QQuickStylePlugin *>(loader.instance()); if (stylePlugin) |