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 void setControlTypeAndState(QQStyleKitExtendableControlType controlType, QQSK::State flags);
145 QObject *target()
const;
146 void setTarget(QObject *target);
148 bool transitionsEnabled()
const;
149 void setTransitionsEnabled(
bool enabled);
151 static void resetReadersForStyle(
const QQStyleKitStyle *style);
153 static QList<QQStyleKitReader *> s_allReaders;
156 void controlTypeChanged();
157 void customTypeChanged();
158 void propertiesChanged();
159 void enabledChanged();
160 void focusedChanged();
161 void checkedChanged();
162 void hoveredChanged();
163 void pressedChanged();
164 void paletteChanged();
165 void verticalChanged();
166 void highlightedChanged();
170 void onPaletteChanged();
173 void updateControl();
174 void populateLocalStorage();
175 bool dontEmitChangedSignals()
const;
177 QQuickStateGroup *stateGroup();
178 QQmlComponent *createControlChangesComponent()
const;
179 QQmlComponent *createDelegateChangesComponent(
const QString &delegateName)
const;
180 void instantiatePropertyChanges(QQmlComponent *comp);
181 void maybeTrackDelegates();
183 bool rebuildEffectivePalette();
184 bool rebuildEffectiveFont();
187 Q_DISABLE_COPY(QQStyleKitReader)
190
191
192
193
194 QQStyleKitExtendableControlType m_type = ControlType::Unspecified;
196 bool m_dontEmitChangedSignals: 1;
197 bool m_effectiveVariationsDirty: 1;
198 bool m_transitionsEnabled: 1;
200 QPointer<QQuickPalette> m_palette;
201 QPalette m_effectivePalette;
203 bool m_fontDirty =
true;
204 quint64 m_lastTextFontOverridesSignature = 0;
205 mutable QQStyleKitPropertyStorage m_storage;
206 AlternateState m_alternateState = AlternateState::Alternate1;
207 QQSK::State m_state = QQSK::StateFlag::Unspecified;
208 QQuickStateGroup *m_stateGroup =
nullptr;
209 QQSK::Delegates m_trackedDelegates = QQSK::Delegate::NoDelegate;
211 QPointer<QObject> m_target;
212 QPointer<QQStyleKitStyle> m_explicitStyle;
213 QPointer<QQStyleKitReader> m_parentReader;
214 QList<QPointer<QQStyleKitVariation>> m_effectiveVariations;
216 QQStyleKitControlProperties m_global;
218 using PropertyChangesComponents = QMap<std::pair<Qt::totally_ordered_wrapper<QQmlEngine*>, QString>, QQmlComponent *>;
219 static PropertyChangesComponents s_propertyChangesComponents;
221 friend class QQStyleKitControlProperties;
222 friend class QQStyleKitPropertyResolver;
223 friend class QQStyleKitPropertyGroup;