diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-12 13:11:56 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-21 20:12:35 +0000 |
commit | 819dc181f79350fa83d59ce90089dbf1a551a99c (patch) | |
tree | 3aeb66e420fc5d63190975b0829826e15cd86406 /src/imports/controls | |
parent | f867450b0b9aba7aa7eb7e344d24229ffed39794 (diff) |
Add the style name as a static file selector
This allows implementing style specific variants that get automatically
chosen by QQmlApplicationEngine's built-in file selector.
:/MyAppToolBar.qml
:/+material/MyAppToolBar.qml
:/+universal/MyAppToolBar.qml
Change-Id: I04a75a0fc4b0b21513733040bbf9d5d309786b47
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls')
-rw-r--r-- | src/imports/controls/qtlabscontrolsplugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/imports/controls/qtlabscontrolsplugin.cpp b/src/imports/controls/qtlabscontrolsplugin.cpp index 008d13a7..37b68ef5 100644 --- a/src/imports/controls/qtlabscontrolsplugin.cpp +++ b/src/imports/controls/qtlabscontrolsplugin.cpp @@ -38,6 +38,7 @@ #include <QtCore/qurl.h> #include <QtCore/qfile.h> #include <QtCore/qcoreapplication.h> +#include <QtCore/private/qfileselector_p.h> #include <QtLabsTemplates/private/qquickabstractbutton_p.h> #include <QtLabsTemplates/private/qquickbuttongroup_p.h> @@ -89,6 +90,10 @@ void QtLabsControlsPlugin::registerTypes(const char *uri) else selector.setBaseUrl(baseUrl()); + const QString style = selector.style(); + if (!style.isEmpty()) + QFileSelectorPrivate::addStatics(QStringList() << style); + qmlRegisterType(selector.select(QStringLiteral("/ApplicationWindow.qml")), uri, 1, 0, "ApplicationWindow"); qmlRegisterType(selector.select(QStringLiteral("/BusyIndicator.qml")), uri, 1, 0, "BusyIndicator"); qmlRegisterType(selector.select(QStringLiteral("/Button.qml")), uri, 1, 0, "Button"); |