37 Q_PROPERTY(QQStyleKitExtendableControlType controlType READ controlType WRITE setControlType NOTIFY controlTypeChanged FINAL)
38 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
39 Q_PROPERTY(
bool focused READ focused WRITE setFocused NOTIFY focusedChanged FINAL)
40 Q_PROPERTY(
bool checked READ checked WRITE setChecked NOTIFY checkedChanged FINAL)
41 Q_PROPERTY(
bool hovered READ hovered WRITE setHovered NOTIFY hoveredChanged FINAL)
42 Q_PROPERTY(
bool pressed READ pressed WRITE setPressed NOTIFY pressedChanged FINAL)
43 Q_PROPERTY(
bool vertical READ vertical WRITE setVertical NOTIFY verticalChanged FINAL)
44 Q_PROPERTY(
bool highlighted READ highlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
45 Q_PROPERTY(QFont font READ font NOTIFY fontChanged FINAL)
46 Q_PROPERTY(QQuickPalette *palette READ palette WRITE setPalette NOTIFY paletteChanged FINAL)
47 Q_PROPERTY(QQStyleKitControlProperties *global READ global CONSTANT FINAL)
49 QML_NAMED_ELEMENT(StyleReader)
90 enum class AlternateState {
94 Q_ENUM(AlternateState)
96 QQStyleKitReader(QObject *parent =
nullptr);
99 QQStyleKitExtendableControlType controlType()
const;
100 void setControlType(QQStyleKitExtendableControlType type);
102 ControlType typeAsControlType()
const;
105 bool hovered()
const;
106 void setHovered(
bool hovered);
108 bool enabled()
const;
109 void setEnabled(
bool enabled);
111 bool focused()
const;
112 void setFocused(
bool focused);
114 bool checked()
const;
115 void setChecked(
bool checked);
117 bool pressed()
const;
118 void setPressed(
bool pressed);
120 QQuickPalette *palette()
const;
121 void setPalette(QQuickPalette *palette);
122 QPalette effectivePalette()
const;
124 bool vertical()
const;
125 void setVertical(
bool vertical);
127 bool highlighted()
const;
128 void setHighlighted(
bool highlighted);
130 QQStyleKitStyle *explicitStyle()
const;
131 void setExplicitStyle(QQStyleKitStyle *style);
135 QQStyleKitControlProperties *global()
const;
137 QVariant readStyleProperty(PropertyStorageId key)
const;
138 void writeStyleProperty(PropertyStorageId key,
const QVariant &value);
139 void clearLocalStorage();
141 QQSK::State controlState()
const;
143 static void setTransitionEnabled(
bool enabled);
144 static bool transitionEnabled();
145 static void resetReadersForStyle(
const QQStyleKitStyle *style);
147 static QList<QQStyleKitReader *> s_allReaders;
150 void controlTypeChanged();
151 void customTypeChanged();
152 void propertiesChanged();
153 void enabledChanged();
154 void focusedChanged();
155 void checkedChanged();
156 void hoveredChanged();
157 void pressedChanged();
158 void paletteChanged();
159 void verticalChanged();
160 void highlightedChanged();
164 void onPaletteChanged();
167 void updateControl();
168 void populateLocalStorage();
169 bool dontEmitChangedSignals()
const;
171 QQuickStateGroup *stateGroup();
172 QQmlComponent *createControlChangesComponent()
const;
173 QQmlComponent *createDelegateChangesComponent(
const QString &delegateName)
const;
174 void instantiatePropertyChanges(QQmlComponent *comp);
175 void maybeTrackDelegates();
177 bool rebuildEffectivePalette();
178 bool rebuildEffectiveFont();
181 Q_DISABLE_COPY(QQStyleKitReader)
184
185
186
187
188 QQStyleKitExtendableControlType m_type = ControlType::Unspecified;
190 bool m_dontEmitChangedSignals: 1;
191 bool m_effectiveVariationsDirty: 1;
193 QPointer<QQuickPalette> m_palette;
194 QPalette m_effectivePalette;
196 bool m_fontDirty =
true;
197 quint64 m_lastTextFontOverridesSignature = 0;
198 mutable QQStyleKitPropertyStorage m_storage;
199 AlternateState m_alternateState = AlternateState::Alternate1;
200 QQSK::State m_state = QQSK::StateFlag::Unspecified;
201 QQuickStateGroup *m_stateGroup =
nullptr;
202 QQSK::Delegates m_trackedDelegates = QQSK::Delegate::NoDelegate;
204 QPointer<QQStyleKitStyle> m_explicitStyle;
205 QPointer<QQStyleKitReader> m_parentReader;
206 QList<QPointer<QQStyleKitVariation>> m_effectiveVariations;
208 QQStyleKitControlProperties m_global;
210 using PropertyChangesComponents = QMap<std::pair<Qt::totally_ordered_wrapper<QQmlEngine*>, QString>, QQmlComponent *>;
211 static PropertyChangesComponents s_propertyChangesComponents;
213 friend class QQStyleKitControlProperties;
214 friend class QQStyleKitPropertyResolver;
215 friend class QQStyleKitPropertyGroup;