5#ifndef QQSTYLEKITGLOBAL_P_H
6#define QQSTYLEKITGLOBAL_P_H
23class QQSK:
public QObject
34 HandleSecond = 0x0010,
36 IndicatorForeground = 0x0040,
38 IndicatorUpForeground = 0x0100,
39 IndicatorDown = 0x0200,
40 IndicatorDownForeground = 0x0400,
42 Q_DECLARE_FLAGS(Delegates, Delegate)
45 enum class PropertyGroup {
58
64
65
66
73 enum class PropertyPathFlag : quint8 {
75 DelegateSubtype0 = 0x1,
76 DelegateSubtype1 = 0x2,
77 DelegateSubtype2 = 0x4,
80 Q_DECLARE_FLAGS(PropertyPathFlags, PropertyPathFlag)
81 Q_FLAG(PropertyPathFlag)
130 enum class StateFlag {
142 Q_DECLARE_FLAGS(State, StateFlag)
145 enum class Subclass {
152 template <
typename T,
typename Owner,
typename... Args>
153 static inline T *lazyCreate(T *
const &ptr,
const Owner *self, Args&&... args)
156 auto *mutableSelf =
const_cast<Owner *>(self);
157 auto *&mutablePtr =
const_cast<T *&>(ptr);
158 mutablePtr =
new T(std::forward<Args>(args)..., mutableSelf);
164Q_DECLARE_OPERATORS_FOR_FLAGS(QQSK::State)
165Q_DECLARE_OPERATORS_FOR_FLAGS(QQSK::Delegates)
166Q_DECLARE_OPERATORS_FOR_FLAGS(QQSK::PropertyPathFlags)
168using PropertyPathId_t = quint32;
169using PropertyStorageId = quint32;
170using QQStyleKitExtendableControlType = quint32;
171using QQStyleKitPropertyStorage = QHash<PropertyStorageId, QVariant>;
177constexpr PropertyPathId_t subtypeCount = PropertyPathId_t(QQSK::PropertyPathFlag::DelegateSubtype2) - PropertyPathId_t(QQSK::PropertyPathFlag::DelegateSubtype0) + 1;
205
206
207
208 return m_groupStart + PropertyPathId_t(m_property);
213
214
215
216
217 Q_ASSERT(state != QQSK::StateFlag::Unspecified);
218 const PropertyPathId_t stateIndex = PropertyPathId_t(state) - 1;
219 const PropertyPathId_t stateStart = stateIndex * stateStorageSpaceSize;
220 return stateStart + pathId();
224 QQSK::Property m_property;
225 PropertyPathId_t m_groupStart;
QQSK::Property property() const
PropertyStorageId storageId(QQSK::State state) const
PropertyPathId_t pathId() const
void setColor(const QColor &color)
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
void setWidth(qreal width)
qreal rightPadding() const
qreal leftPadding() const
void leftPaddingChanged()
QQStyleKitTextProperties * text() const
void setTopPadding(qreal topPadding)
QQSK::Subclass subclass() const
void emitChangedForAllStyleProperties()
void rightPaddingChanged()
QQStyleKitIndicatorWithSubTypes * indicator() const
void setTransition(QQuickTransition *transition)
void setSpacing(qreal spacing)
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
QQStyleKitDelegateProperties * background() const
QQStyleKitStyle * style() const
void setRightPadding(qreal rightPadding)
QQStyleKitReader * asQQStyleKitReader() const
QQuickTransition * transition() const
QQStyleKitHandleProperties * handle() const
QQStyleKitControlState * asQQStyleKitState() const
void forEachUsedDelegate(std::function< void(QQStyleKitDelegateProperties *, QQSK::Delegate, const QString &)> f)
void setBottomPadding(qreal bottomPadding)
void setPadding(qreal padding)
void setLeftPadding(qreal leftPadding)
void bottomPaddingChanged()
qreal bottomPadding() const
void parentControlChanged()
void setParentControl(QObject *control)
~QQStyleKitDelegateContainer() override
QQStyleKitDelegateProperties * delegateProperties() const
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void delegateInstanceChanged()
void setDelegateProperties(QQStyleKitDelegateProperties *delegateProperties)
QQuickItem * delegateInstance() const
QObject * parentControl() const
QQStyleKitDelegateProperties * first() const
QQStyleKitDelegateProperties * second() const
void setColor(const QColor &color)
QQuickImage::FillMode fillMode() const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
void setFillMode(QQuickImage::FillMode fillMode)
void setSource(const QUrl &source)
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
void emitChangedForAllStylePropertiesRecursive()
QQSK::PropertyPathFlags pathFlags() const
void handleStylePropertyChanged(void(SUBCLASS::*changedSignal)())
QQSK::PropertyPathFlags m_pathFlags
PropertyPathId propertyPathId(QQSK::Property property, PropertyPathId::Flag flag) const
void handleStylePropertiesChanged(CHANGED_SIGNALS... changedSignals)
bool isDefined(QQSK::Property property) const
QQStyleKitControlProperties * controlProperties() const
QString pathToString() const
bool isControlProperties() const
void setRightPadding(qreal rightPadding)
void setBottomPadding(qreal bottomPadding)
void setTopPadding(qreal topPadding)
void setLeftPadding(qreal leftPadding)
void setPadding(qreal padding)
qreal rightPadding() const
void setItalic(bool italic)
void setAlignment(Qt::Alignment alignment)
qreal bottomPadding() const
void setPointSize(qreal pointSize)
void setColor(const QColor &color)
void bottomPaddingChanged()
Qt::Alignment alignment() const
void emitGlobally(QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals) const
void rightPaddingChanged()
void leftPaddingChanged()
qreal leftPadding() 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