diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-03-15 13:41:54 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-03-16 12:06:11 +0000 |
commit | 7dbe1348cc7270a28026b012610f5a2bbe7ae429 (patch) | |
tree | 989c72ef932f14c86443ed618254c346ddd61089 /src/quickcontrols2/qquickstyle.h | |
parent | 87d3e84c75839b736d45f2773fc5fb4ecce14296 (diff) |
QQuickStyle: add API for managing style paths
In order to be able to use/refer to/select styles by name:
- ./myapp -style Glossy
- :/qtquickcontrols2.conf: [Controls] Style=Glossy
- QT_QUICK_CONTROLS_STYLE=Glossy ./myapp
the style needs to be available in a place where QQC2 can find it
by the given name. Normally, QQC2 scans for available styles in the
QT_INSTALL_QML/QtQuick/Controls.2/ directory, where all the built-in
styles reside. However, 3rd party styles may want to install styles
into their own namespace, especially if they offer style-specific API.
If a style is installed elsewhere, QQC2 needs to be made aware of the
style path to make it possible to locate the style. Previously, the
QT_QUICK_CONTROLS_STYLE_PATH environment variable was the only way.
This adds proper C++ API, inspired by QQmlEngine's importPathList
and pluginPathList, to manage QQC2 style paths.
[ChangeLog][Controls][QQuickStyle] Added stylePathList() and
addStylePath() methods for managing the list of directories where
Qt Quick Controls 2 searches for available styles.
Task-number: QTBUG-67062
Change-Id: I1e85b5e09ba869483c0937ac61a0a2dcfc8e774e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quickcontrols2/qquickstyle.h')
-rw-r--r-- | src/quickcontrols2/qquickstyle.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickstyle.h b/src/quickcontrols2/qquickstyle.h index ab79c3e0..ce55b76b 100644 --- a/src/quickcontrols2/qquickstyle.h +++ b/src/quickcontrols2/qquickstyle.h @@ -51,6 +51,8 @@ public: static void setStyle(const QString &style); static void setFallbackStyle(const QString &style); static QStringList availableStyles(); + static QStringList stylePathList(); + static void addStylePath(const QString &path); }; QT_END_NAMESPACE |