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
qqstylekitpropertyresolver_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 QQSTYLEKITPROPERTYRESOLVER_P_H
6#define QQSTYLEKITPROPERTYRESOLVER_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
19#include <QtQml/QtQml>
20
22
24
27class QQStyleKitStyle;
30
32{
34
35public:
36 enum class PathId { // REMOVE THIS AS WELL
39 };
40 Q_ENUM(PathId)
41
48
50 const QQStyleKitPropertyGroup *group,
51 const QQSK::Property property,
52 const QQSK::Property alternative = QQSK::Property::NoProperty);
53
54 static bool writeStyleProperty(
55 const QQStyleKitPropertyGroup *group,
56 const QQSK::Property property,
57 const QVariant &value);
58
59 static bool hasLocalStyleProperty(
60 const QQStyleKitPropertyGroup *group,
61 const QQSK::Property property);
62
64 QQStyleKitExtendableControlType exactType);
65
66private:
67 static bool s_styleWarningsIssued;
68 static bool s_isReadingProperty;
69 static QQSK::State s_cachedState;
70 static QVarLengthArray<QQSK::StateFlag, 10> s_cachedStateList;
71
72private:
73 template <class T>
74 static QVariant readPropertyInStorageForState(
75 const PropertyPathId main, const PropertyPathId alternative,
76 const T *storageProvider, QQSK::State state);
77
78 template <class INDICES_CONTAINER>
79 static QVariant readPropertyInControlForStates(
80 const PropertyPathId main, const PropertyPathId alternative,
81 const QQStyleKitControl *control, INDICES_CONTAINER &stateListIndices,
82 int startIndex, int recursionLevel);
83
84 static QVariant readPropertyInControl(
85 const PropertyPathIds &ids, const QQStyleKitControl *control);
86
87 static QVariant readPropertyInRelevantControls(
88 const QQStyleKitControls *controls, const PropertyPathIds &ids,
89 const QQStyleKitExtendableControlType exactType,
90 const QList<QQStyleKitExtendableControlType> baseTypes);
91
92 static QVariant readPropertyInStyle(
93 const PropertyPathIds &ids,
94 const QQStyleKitExtendableControlType exactType,
95 const QList<QQStyleKitExtendableControlType> baseTypes,
96 const QQStyleKitStyle *style);
97
98 static QVariant readProperty(
99 const PropertyPathIds &ids,
100 QQStyleKitReader *styleReader,
101 QQStyleKitStyle *style);
102
103 static void cacheReaderState(QQSK::State state);
104 static void addInstanceVariationsToReader(
105 QQStyleKitReader *styleReader,
106 const QStringList &inAppVariationNames,
107 const QVarLengthArray<const QQStyleKitControls *, 6> &stylesAndThemes);
108 static void addTypeVariationsToReader(
109 QQStyleKitReader *styleReader,
110 const QQStyleKitExtendableControlType parentType,
111 const QQStyleKitStyle *style);
112 static void rebuildVariationsForReader(
113 QQStyleKitReader *styleReader,
114 const QQStyleKitStyle *style);
115};
116
117QT_END_NAMESPACE
118
119#endif // QQSTYLEKITPROPERTYRESOLVER_P_H
QQSK::Property property() const
PropertyStorageId storageId(QQSK::State state) const
PropertyPathId_t pathId() const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
QQStyleKitTextProperties * text() const
QQStyleKitIndicatorWithSubTypes * indicator() const
void setTransition(QQuickTransition *transition)
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
QQStyleKitDelegateProperties * background() const
QQStyleKitReader * asQQStyleKitReader() const
QQStyleKitHandleProperties * handle() const
QQStyleKitControlState * asQQStyleKitState() const
void forEachUsedDelegate(std::function< void(QQStyleKitDelegateProperties *, QQSK::Delegate, const QString &)> f)
QQStyleKitDelegateProperties * delegateProperties() const
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setDelegateProperties(QQStyleKitDelegateProperties *delegateProperties)
QQStyleKitDelegateProperties * first() const
QQStyleKitDelegateProperties * second() const
QQuickImage::FillMode fillMode() const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
void setFillMode(QQuickImage::FillMode fillMode)
QQStyleKitDelegateProperties * foreground() const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
QQStyleKitDelegateProperties * foreground() const
QQStyleKitIndicatorProperties * down() const
QQStyleKitIndicatorProperties * up() const
bool setStyleProperty(QQSK::Property property, T value)
QQStyleKitPropertyGroupSpace m_groupSpace
T styleProperty(QQSK::Property property, const T &defaultValue) const
T styleProperty(QQSK::Property property, QQSK::Property alternative=QQSK::Property::NoProperty) const
T * lazyCreateGroup(T *const &ptr, QQSK::PropertyGroup group) const
QQSK::PropertyPathFlags pathFlags() const
void handleStylePropertyChanged(void(SUBCLASS::*changedSignal)())
PropertyPathId propertyPathId(QQSK::Property property, PropertyPathId::Flag flag) const
void handleStylePropertiesChanged(CHANGED_SIGNALS... changedSignals)
bool isDefined(QQSK::Property property) const
QQStyleKitControlProperties * controlProperties() const
static QVariant readStyleProperty(const QQStyleKitPropertyGroup *group, const QQSK::Property property, const QQSK::Property alternative=QQSK::Property::NoProperty)
static bool hasLocalStyleProperty(const QQStyleKitPropertyGroup *group, const QQSK::Property property)
static const QList< QQStyleKitExtendableControlType > baseTypesForType(QQStyleKitExtendableControlType exactType)
static bool writeStyleProperty(const QQStyleKitPropertyGroup *group, const QQSK::Property property, const QVariant &value)
void setRightPadding(qreal rightPadding)
void setBottomPadding(qreal bottomPadding)
void setAlignment(Qt::Alignment alignment)
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
Combined button and popup list for selecting options.
constexpr PropertyPathId_t nestedGroupCount
constexpr PropertyPathId_t nestedGroupsStartSize
constexpr PropertyPathId_t maxStateCombinationCount
constexpr PropertyPathId_t subtypeStorageSpaceSize
constexpr PropertyPathId_t stateStorageSpaceSize
constexpr PropertyPathId_t subtypeCount
constexpr PropertyPathId_t maxPropertyStorageSpaceSize