diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-06 00:11:25 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-25 07:20:59 +0000 |
commit | 32810acaa191ba00be5aac5d771c23b87628292c (patch) | |
tree | 0c45b6ab2da561612032aa66a542cb89b9128b5a /src/quickcontrols2/qquickstyleselector_p_p.h | |
parent | 6ba40b132562593781ceffc13f642d366d6ad672 (diff) |
Let specifying the fallback style for custom styles
For example, you can call QQuickStyle::setStyle(":/mycontrols") and
QQuickStyle::setFallbackStyle("Material") to select a custom style so
that the missing files will fallback to the Material style.
Notice that the Material and Universal styles do not contain all files.
For example, the non-visual Control.qml, Container.qml are not duplicated.
For these, we must fallback to the Default style that is guaranteed to
contain them all.
[ChangeLog][Controls] Added support for specifying the fallback style for
custom styles via :/qtquickcontrols2.conf, QT_QUICK_CONTROLS_FALLBACK_STYLE
or QQuickStyle::setFallbackStyle().
Change-Id: I00be1c8c6aaca875ef851c90d018e9b5e2f501b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quickcontrols2/qquickstyleselector_p_p.h')
-rw-r--r-- | src/quickcontrols2/qquickstyleselector_p_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quickcontrols2/qquickstyleselector_p_p.h b/src/quickcontrols2/qquickstyleselector_p_p.h index cc3f0a58..4ff28d5d 100644 --- a/src/quickcontrols2/qquickstyleselector_p_p.h +++ b/src/quickcontrols2/qquickstyleselector_p_p.h @@ -54,9 +54,12 @@ class QQuickStyleSelectorPrivate { public: QString select(const QString &filePath) const; + QString trySelect(const QString &filePath, const QString &fallback = QString()) const; QUrl baseUrl; - QString style; + QString basePath; + QString styleName; + QString stylePath; }; QT_END_NAMESPACE |