37 Q_PROPERTY(QQuickPalette *palette READ palette NOTIFY paletteChanged FINAL)
38 Q_PROPERTY(QQStyleKitStyle *fallbackStyle READ fallbackStyle WRITE setFallbackStyle NOTIFY fallbackStyleChanged FINAL)
39 Q_PROPERTY(QQmlComponent *light READ light WRITE setLight NOTIFY lightChanged FINAL)
40 Q_PROPERTY(QQmlComponent *dark READ dark WRITE setDark NOTIFY darkChanged FINAL)
41 Q_PROPERTY(QString themeName READ themeName WRITE setThemeName NOTIFY themeNameChanged FINAL)
42 Q_PROPERTY(QStringList themeNames READ themeNames NOTIFY themeNamesChanged FINAL)
43 Q_PROPERTY(QStringList customThemeNames READ customThemeNames NOTIFY customThemeNamesChanged FINAL)
44 Q_PROPERTY(QQStyleKitTheme *theme READ theme NOTIFY themeChanged FINAL)
46 Q_CLASSINFO(
"DeferredPropertyNames",
"fallbackStyle")
47 QML_NAMED_ELEMENT(BaseStyle)
50 QQStyleKitStyle(QObject *parent =
nullptr);
53 QQuickPalette *palette()
const;
55 QQStyleKitStyle *fallbackStyle()
const;
56 void setFallbackStyle(QQStyleKitStyle *fallbackStyle);
58 QQmlComponent *light()
const;
59 void setLight(QQmlComponent *lightTheme);
61 QQmlComponent *dark()
const;
62 void setDark(QQmlComponent *darkTheme);
64 QList<QQStyleKitCustomTheme *> customThemes()
const;
65 QStringList themeNames()
const;
66 QStringList customThemeNames()
const;
68 void setThemeName(
const QString &themeName);
69 QString themeName()
const;
70 QQStyleKitTheme *theme()
const;
75 static QQStyleKitStyle *current();
77 QPalette paletteForControlType(QQStyleKitExtendableControlType type)
const;
78 QFont fontForControlType(QQStyleKitExtendableControlType type)
const;
81 Q_INVOKABLE QList<QObject *> customThemesAsList();
84 void paletteChanged();
85 void fallbackStyleChanged();
89 void themeNameChanged();
90 void themeNamesChanged();
91 void customThemeNamesChanged();
94 void componentComplete() override;
99 void executeFallbackStyle(
bool complete =
false);
100 void syncFromQPalette(
const QPalette &palette);
101 QPalette effectivePalette()
const;
103 Q_DISABLE_COPY(QQStyleKitStyle)
105 bool m_completed =
false;
106 bool m_isUpdatingPalette =
false;
107 bool m_hasVariations =
false;
109 QQuickDeferredPointer<QQStyleKitStyle> m_fallbackStyle;
110 QPointer<QQmlComponent> m_light;
111 QPointer<QQmlComponent> m_dark;
112 QPointer<QQStyleKitTheme> m_theme;
113 QPointer<QQmlComponent> m_currentThemeComponent;
114 QQuickPalette *m_paletteProxy =
nullptr;
115 QPalette m_effectivePalette;
116 QPointer<QQuickPalette> m_palette;
118 QString m_effectiveThemeName;
119 QStringList m_themeNames;
120 QStringList m_customThemeNames;
122 friend class QQStyleKitAttached;
123 friend class QQStyleKitPropertyGroup;
124 friend class QQStyleKitPropertyResolver;
125 friend class QQStyleKitDebug;
126 friend class QQStyleKitVariation;