Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqstylekitstyle_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQSTYLEKITSTYLE_P_H
6#define QQSTYLEKITSTYLE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
24
25#include <QtQml/QtQml>
26#include <QtQuickTemplates2/private/qquickdeferredpointer_p_p.h>
27
29
30class QQStyleKitTheme;
32
34{
35 Q_OBJECT
36 Q_PROPERTY(QQuickPalette *palette READ palette NOTIFY paletteChanged FINAL)
44
45 Q_CLASSINFO("DeferredPropertyNames", "fallbackStyle")
47
48public:
50 Stretch = -1,
51 };
52 Q_ENUM(Contstants)
53
54 QQStyleKitStyle(QObject *parent = nullptr);
56
57 QQuickPalette *palette() const;
58
60 void setFallbackStyle(QQStyleKitStyle *fallbackStyle);
61
62 QQmlComponent *light() const;
63 void setLight(QQmlComponent *lightTheme);
64
65 QQmlComponent *dark() const;
66 void setDark(QQmlComponent *darkTheme);
67
69 QStringList themeNames() const;
71
72 void setThemeName(const QString &themeName);
73 QString themeName() const;
74 QQStyleKitTheme *theme() const;
75
76 bool loaded() const;
77
78 static QQStyleKitStyle *current();
79
80 QPalette paletteForControlType(QQStyleKitExtendableControlType type) const;
81 QFont fontForControlType(QQStyleKitExtendableControlType type) const;
82
83 // For now, used by qqcontrolstowidgetstyle
85
95
96protected:
98
99private:
100 void parseThemes();
101 void recreateTheme();
102 void executeFallbackStyle(bool complete = false);
103 void syncFromQPalette(const QPalette &palette);
104 QPalette effectivePalette() const;
105
107
108 bool m_completed = false;
109 bool m_isUpdatingPalette = false;
110
111 QQuickDeferredPointer<QQStyleKitStyle> m_fallbackStyle;
112 QPointer<QQmlComponent> m_light;
113 QPointer<QQmlComponent> m_dark;
114 QPointer<QQStyleKitTheme> m_theme;
115 QPointer<QQmlComponent> m_currentThemeComponent;
116 QQuickPalette *m_paletteProxy = nullptr;
117 QPalette m_effectivePalette;
118 QPointer<QQuickPalette> m_palette;
119 QString m_themeName;
120 QString m_effectiveThemeName;
121 QStringList m_themeNames;
122 QStringList m_customThemeNames;
123
124 friend class QQStyleKitAttached;
127};
128
129QT_END_NAMESPACE
130
131#endif // QQSTYLEKITSTYLE_P_H
Q_INVOKABLE bool styleLoaded() const
void setStyleUrl(const QString &styleUrl)
QQStyleKitStyle * style() const
void transitionsEnabledChanged()
void setStyle(QQStyleKitStyle *style)
void setTransitionsEnabled(bool enabled)
QQStyleKitDebug * debug() const
bool transitionsEnabled() const
QString styleUrl() const
void filterChanged()
QString filter() const
void setFilter(const QString &filter)
void setControl(QQuickItem *item)
static Q_INVOKABLE bool insideControl(const QObject *child)
void customThemeNamesChanged()
void themeNamesChanged()
QList< QQStyleKitCustomTheme * > customThemes() const
QStringList themeNames() const
void themeNameChanged()
QQmlComponent * dark() const
QQmlComponent * light() const
QStringList customThemeNames() const
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QQStyleKitStyle * fallbackStyle() const
QQStyleKitTheme * theme() const
void fallbackStyleChanged()
static QQStyleKitStyle * current()
QQuickPalette * palette() const
void setThemeName(const QString &themeName)
void setDark(QQmlComponent *darkTheme)
QPalette paletteForControlType(QQStyleKitExtendableControlType type) const
QFont fontForControlType(QQStyleKitExtendableControlType type) const
void setLight(QQmlComponent *lightTheme)
QString themeName() const
void setFallbackStyle(QQStyleKitStyle *fallbackStyle)
static QQStyleKitAttached * qmlAttachedProperties(QObject *obj=nullptr)
Combined button and popup list for selecting options.