14QHash<PropertyPathId_t, QString> QQStyleKitPropertyGroup::s_pathStrings;
23 if (flag == PropertyPathId::Flag::IncludeSubtype) {
24 if (m_pathFlags.testFlag(QQSK::PropertyPathFlag::DelegateSubtype1))
25 return PropertyPathId(property, m_groupSpace.start, QQSK::PropertyGroup::DelegateSubtype1);
26 else if (m_pathFlags.testFlag(QQSK::PropertyPathFlag::DelegateSubtype2))
27 return PropertyPathId(property, m_groupSpace.start, QQSK::PropertyGroup::DelegateSubtype2);
29 return PropertyPathId(property, m_groupSpace.start, QQSK::PropertyGroup::DelegateSubtype0);
35
36
37
38
39
40
41
42
43
44 if (s_pathStrings.contains(m_groupSpace.start))
45 return s_pathStrings[m_groupSpace.start];
47 constexpr PropertyPathId_t rootGroupsSize = nestedGroupsStartSize / nestedGroupCount;
48 const auto metaEnum = QMetaEnum::fromType<QQSK::PropertyGroup>();
50 PropertyPathId_t nestedGroupStart = m_groupSpace.start;
51 PropertyPathId_t nestedGroupSize = rootGroupsSize;
52 PropertyPathId_t nestedGroupIndex = nestedGroupStart / nestedGroupSize;
53 auto groupType = QQSK::PropertyGroup(nestedGroupIndex);
54 if (groupType == QQSK::PropertyGroup::Control)
57 QString groupName = QString::fromLatin1(metaEnum.valueToKey(
static_cast<
int>(groupType)));
58 groupName[0] = groupName[0].toLower();
59 QString pathString = groupName;
62 nestedGroupStart -= nestedGroupIndex * nestedGroupSize;
63 nestedGroupSize /= nestedGroupCount;
64 nestedGroupIndex = nestedGroupStart / nestedGroupSize;
65 groupType = QQSK::PropertyGroup(nestedGroupIndex);
66 if (groupType == QQSK::PropertyGroup::Control)
69 QString groupName = QString::fromLatin1(metaEnum.valueToKey(
static_cast<
int>(groupType)));
70 groupName[0] = groupName[0].toLower();
71 pathString +=
'.'_L1 + groupName;
74 s_pathStrings.insert(m_groupSpace.start, pathString);
83 return static_cast<QQStyleKitControlProperties *>(self);
92 T *nestedGroup = QQSK::lazyCreate(ptr, controlProperties(), group);
95 nestedGroup->m_pathFlags = m_pathFlags;
97 if (group == QQSK::PropertyGroup::DelegateSubtype1) {
99
100
101
102
103
104
105 nestedGroup->m_pathFlags.setFlag(QQSK::PropertyPathFlag::DelegateSubtype1);
106 nestedGroup->m_groupSpace = m_groupSpace;
107 }
else if (group == QQSK::PropertyGroup::DelegateSubtype2) {
108 nestedGroup->m_pathFlags.setFlag(QQSK::PropertyPathFlag::DelegateSubtype2);
109 nestedGroup->m_groupSpace = m_groupSpace;
112
113
114 const PropertyPathId_t nestedGroupIndex = PropertyPathId_t(group);
115 const PropertyPathId_t nestedGroupSize = m_groupSpace.size / nestedGroupCount;
116 nestedGroup->m_groupSpace.size = nestedGroupSize;
117 nestedGroup->m_groupSpace.start = m_groupSpace.start + (nestedGroupIndex * nestedGroupSize);
119
120
121
122
123
124 Q_ASSERT(nestedGroupSize >= PropertyPathId_t(QQSK::Property::COUNT));
130
131
132
133
134
135
136
137
138
139
140#define CONDITIONALLY_EMIT_SIGNALS_GLOBALLY_FOR(CONTROL_PROPERTIES, GROUP_PATH) if
141 (this == CONTROL_PROPERTIES -> GROUP_PATH ) {
142 for (QQStyleKitReader *reader : QQStyleKitReader::s_allReaders) {
143 const auto baseTypes = QQStyleKitPropertyResolver::baseTypesForType(reader->type());
144 if (reader->type() != controlType && !baseTypes.contains(controlType))
146 reader->clearLocalStorage();
147 ((reader-> GROUP_PATH ->*changedSignals)(), ...);
150}
152template<
typename SUBCLASS>
154 handleStylePropertiesChanged<SUBCLASS>(changedSignal);
157template <
typename SUBCLASS,
typename... CHANGED_SIGNALS>
161
162
163
164
165
166
167
168 static_assert(std::is_base_of<QQStyleKitPropertyGroup, SUBCLASS>::value,
169 "SUBCLASS must inherit QQStyleKitPropertyGroup");
171 auto *group =
static_cast<SUBCLASS *>(
this);
174 if (objectWrittenTo == QQSK::Subclass::QQStyleKitState) {
175 ((group->*changedSignals)(), ...);
177 if (shouldEmitGlobally()) {
179 const QQStyleKitExtendableControlType type = control->controlType();
180 group->emitGlobally(type, changedSignals...);
185 if (objectWrittenTo == QQSK::Subclass::QQStyleKitReader) {
187
188
189
190 if (shouldEmitLocally())
191 ((group->*changedSignals)(), ...);
201
202
203 const int startIndex = QQStyleKitPropertyGroup::staticMetaObject.propertyOffset();
204 const QMetaObject* meta = metaObject();
205 for (
int i = startIndex; i < meta->propertyCount(); ++i) {
206 const QMetaProperty prop = meta->property(i);
207 const QMetaObject* metaObject = QMetaType::fromName(prop.typeName()).metaObject();
209 if (metaObject->inherits(&QQStyleKitDelegateProperties::staticMetaObject)) {
211
212
215 if (metaObject->inherits(&QQStyleKitPropertyGroup::staticMetaObject)) {
217 QObject *childObj = qvariant_cast<QObject *>(property(prop.name()));
218 if (
auto *child = qobject_cast<QQStyleKitPropertyGroup *>(childObj))
219 child->emitChangedForAllStylePropertiesRecursive();
225 Q_ASSERT(prop.hasNotifySignal());
226 QMetaMethod notify = prop.notifySignal();
227 notify.invoke(
this, Qt::DirectConnection);
242 if (parentStyle
->loaded() && !parentStyle->m_isUpdatingPalette) {
244
245
246
247
248
249
262template <
typename... CHANGED_SIGNALS>
264 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
276 return styleProperty<QUrl>(QQSK::Property::Source);
281 if (setStyleProperty(QQSK::Property::Source, source))
282 handleStylePropertyChanged(&QQStyleKitImageProperties::sourceChanged);
287 return styleProperty<QColor>(QQSK::Property::Color);
292 if (setStyleProperty(QQSK::Property::Color, color))
298 return styleProperty<QQuickImage::FillMode>(QQSK::Property::FillMode);
303 if (setStyleProperty(QQSK::Property::FillMode, fillMode))
304 handleStylePropertyChanged(&QQStyleKitImageProperties::fillModeChanged);
314template <
typename... CHANGED_SIGNALS>
316 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
328 return styleProperty<qreal>(QQSK::Property::Width);
333 if (setStyleProperty(QQSK::Property::Width, width))
334 handleStylePropertyChanged(&QQStyleKitBorderProperties::widthChanged);
339 return styleProperty<QColor>(QQSK::Property::Color, Qt::transparent);
344 if (setStyleProperty(QQSK::Property::Color, color))
350QQStyleKitShadowProperties::QQStyleKitShadowProperties(QQSK::PropertyGroup group, QQStyleKitControlProperties *parent)
351 : QQStyleKitPropertyGroup(group, parent)
355template <
typename... CHANGED_SIGNALS>
356void QQStyleKitShadowProperties::emitGlobally(
357 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
360 const QQStyleKitControlProperties *cp = controlProperties();
367QColor QQStyleKitShadowProperties::color()
const
369 return styleProperty<QColor>(QQSK::Property::Color, Qt::transparent);
372void QQStyleKitShadowProperties::setColor(QColor color)
374 if (setStyleProperty(QQSK::Property::Color, color))
375 handleStylePropertyChanged(&QQStyleKitShadowProperties::colorChanged);
378qreal QQStyleKitShadowProperties::opacity()
const
380 return styleProperty<qreal>(QQSK::Property::Opacity, 1.0);
383void QQStyleKitShadowProperties::setOpacity(qreal opacity)
385 if (setStyleProperty(QQSK::Property::Opacity, opacity))
386 handleStylePropertyChanged(&QQStyleKitShadowProperties::opacityChanged);
389qreal QQStyleKitShadowProperties::scale()
const
391 return styleProperty<qreal>(QQSK::Property::Scale, 1.0);
394void QQStyleKitShadowProperties::setScale(qreal scale)
396 if (setStyleProperty(QQSK::Property::Scale, scale))
397 handleStylePropertyChanged(&QQStyleKitShadowProperties::scaleChanged);
400qreal QQStyleKitShadowProperties::verticalOffset()
const
402 return styleProperty<qreal>(QQSK::Property::VOffset);
405void QQStyleKitShadowProperties::setVerticalOffset(qreal verticalOffset)
407 if (setStyleProperty(QQSK::Property::VOffset, verticalOffset))
408 handleStylePropertyChanged(&QQStyleKitShadowProperties::verticalOffsetChanged);
411qreal QQStyleKitShadowProperties::horizontalOffset()
const
413 return styleProperty<qreal>(QQSK::Property::HOffset);
416void QQStyleKitShadowProperties::setHorizontalOffset(qreal horizontalOffset)
418 if (setStyleProperty(QQSK::Property::HOffset, horizontalOffset))
419 handleStylePropertyChanged(&QQStyleKitShadowProperties::horizontalOffsetChanged);
422qreal QQStyleKitShadowProperties::blur()
const
424 return styleProperty<qreal>(QQSK::Property::Blur, 10.0);
427void QQStyleKitShadowProperties::setBlur(qreal blur)
429 if (setStyleProperty(QQSK::Property::Blur, blur))
430 handleStylePropertyChanged(&QQStyleKitShadowProperties::blurChanged);
433bool QQStyleKitShadowProperties::visible()
const
435 return styleProperty<
bool>(QQSK::Property::Visible,
true);
438void QQStyleKitShadowProperties::setVisible(
bool visible)
440 if (setStyleProperty(QQSK::Property::Visible, visible))
441 handleStylePropertyChanged(&QQStyleKitShadowProperties::visibleChanged);
444QQmlComponent *QQStyleKitShadowProperties::delegate()
const
446 return styleProperty<QQmlComponent *>(QQSK::Property::Delegate);
449void QQStyleKitShadowProperties::setDelegate(QQmlComponent *delegate)
451 if (setStyleProperty(QQSK::Property::Delegate, delegate))
452 handleStylePropertyChanged(&QQStyleKitShadowProperties::delegateChanged);
457QQStyleKitDelegateProperties::QQStyleKitDelegateProperties(QQSK::PropertyGroup group, QQStyleKitControlProperties *parent)
458 : QQStyleKitPropertyGroup(group, parent)
462template <
typename... CHANGED_SIGNALS>
463void QQStyleKitDelegateProperties::emitGlobally(
464 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
467 const QQStyleKitControlProperties *cp = controlProperties();
474qreal QQStyleKitDelegateProperties::radius()
const
476 return styleProperty<qreal>(QQSK::Property::Radius);
479void QQStyleKitDelegateProperties::setRadius(qreal radius)
481 if (setStyleProperty(QQSK::Property::Radius, radius))
482 handleStylePropertiesChanged<QQStyleKitDelegateProperties>(
483 &QQStyleKitDelegateProperties::radiusChanged,
484 &QQStyleKitDelegateProperties::topLeftRadiusChanged,
485 &QQStyleKitDelegateProperties::topRightRadiusChanged,
486 &QQStyleKitDelegateProperties::bottomLeftRadiusChanged,
487 &QQStyleKitDelegateProperties::bottomRightRadiusChanged);
490qreal QQStyleKitDelegateProperties::topLeftRadius()
const
492 return styleProperty<qreal>(QQSK::Property::TopLeftRadius, QQSK::Property::Radius);
495void QQStyleKitDelegateProperties::setTopLeftRadius(qreal radius)
497 if (setStyleProperty(QQSK::Property::TopLeftRadius, radius))
498 handleStylePropertyChanged(&QQStyleKitDelegateProperties::topLeftRadiusChanged);
501qreal QQStyleKitDelegateProperties::topRightRadius()
const
503 return styleProperty<qreal>(QQSK::Property::TopRightRadius, QQSK::Property::Radius);
506void QQStyleKitDelegateProperties::setTopRightRadius(qreal radius)
508 if (setStyleProperty(QQSK::Property::TopRightRadius, radius))
509 handleStylePropertyChanged(&QQStyleKitDelegateProperties::topRightRadiusChanged);
512qreal QQStyleKitDelegateProperties::bottomLeftRadius()
const
514 return styleProperty<qreal>(QQSK::Property::BottomLeftRadius, QQSK::Property::Radius);
517void QQStyleKitDelegateProperties::setBottomLeftRadius(qreal radius)
519 if (setStyleProperty(QQSK::Property::BottomLeftRadius, radius))
520 handleStylePropertyChanged(&QQStyleKitDelegateProperties::bottomLeftRadiusChanged);
523qreal QQStyleKitDelegateProperties::bottomRightRadius()
const
525 return styleProperty<qreal>(QQSK::Property::BottomRightRadius, QQSK::Property::Radius);
528void QQStyleKitDelegateProperties::setBottomRightRadius(qreal radius)
530 if (setStyleProperty(QQSK::Property::BottomRightRadius, radius))
531 handleStylePropertyChanged(&QQStyleKitDelegateProperties::bottomRightRadiusChanged);
534qreal QQStyleKitDelegateProperties::scale()
const
536 return styleProperty<qreal>(QQSK::Property::Scale, 1.0);
539void QQStyleKitDelegateProperties::setScale(qreal scale)
541 if (setStyleProperty(QQSK::Property::Scale, scale))
542 handleStylePropertyChanged(&QQStyleKitDelegateProperties::scaleChanged);
545qreal QQStyleKitDelegateProperties::rotation()
const
547 return styleProperty<qreal>(QQSK::Property::Rotation);
550void QQStyleKitDelegateProperties::setRotation(qreal rotation)
552 if (setStyleProperty(QQSK::Property::Rotation, rotation))
553 handleStylePropertyChanged(&QQStyleKitDelegateProperties::rotationChanged);
556qreal QQStyleKitDelegateProperties::implicitWidth()
const
558 return styleProperty<qreal>(QQSK::Property::ImplicitWidth);
561void QQStyleKitDelegateProperties::setImplicitWidth(qreal width)
563 if (setStyleProperty(QQSK::Property::ImplicitWidth, width))
564 handleStylePropertyChanged(&QQStyleKitDelegateProperties::implicitWidthChanged);
567qreal QQStyleKitDelegateProperties::implicitHeight()
const
569 return styleProperty<qreal>(QQSK::Property::ImplicitHeight);
572void QQStyleKitDelegateProperties::setImplicitHeight(qreal height)
574 if (setStyleProperty(QQSK::Property::ImplicitHeight, height))
575 handleStylePropertyChanged(&QQStyleKitDelegateProperties::implicitHeightChanged);
578qreal QQStyleKitDelegateProperties::minimumWidth()
const
580 return styleProperty<qreal>(QQSK::Property::MinimumWidth);
583void QQStyleKitDelegateProperties::setMinimumWidth(qreal width)
585 if (setStyleProperty(QQSK::Property::MinimumWidth, width))
586 handleStylePropertyChanged(&QQStyleKitDelegateProperties::minimumWidthChanged);
589qreal QQStyleKitDelegateProperties::margins()
const
591 return styleProperty<qreal>(QQSK::Property::Margins);
594void QQStyleKitDelegateProperties::setMargins(qreal margins)
596 if (setStyleProperty(QQSK::Property::Margins, margins))
597 handleStylePropertiesChanged<QQStyleKitDelegateProperties>(
598 &QQStyleKitDelegateProperties::marginsChanged,
599 &QQStyleKitDelegateProperties::leftMarginChanged,
600 &QQStyleKitDelegateProperties::rightMarginChanged,
601 &QQStyleKitDelegateProperties::topMarginChanged,
602 &QQStyleKitDelegateProperties::bottomMarginChanged);
605qreal QQStyleKitDelegateProperties::leftMargin()
const
607 return styleProperty<qreal>(QQSK::Property::LeftMargin, QQSK::Property::Margins);
610void QQStyleKitDelegateProperties::setLeftMargin(qreal margin)
612 if (setStyleProperty(QQSK::Property::LeftMargin, margin))
613 handleStylePropertyChanged(&QQStyleKitDelegateProperties::leftMarginChanged);
616qreal QQStyleKitDelegateProperties::rightMargin()
const
618 return styleProperty<qreal>(QQSK::Property::RightMargin, QQSK::Property::Margins);
621void QQStyleKitDelegateProperties::setRightMargin(qreal margin)
623 if (setStyleProperty(QQSK::Property::RightMargin, margin))
624 handleStylePropertyChanged(&QQStyleKitDelegateProperties::rightMarginChanged);
627qreal QQStyleKitDelegateProperties::topMargin()
const
629 return styleProperty<qreal>(QQSK::Property::TopMargin, QQSK::Property::Margins);
632void QQStyleKitDelegateProperties::setTopMargin(qreal margin)
634 if (setStyleProperty(QQSK::Property::TopMargin, margin))
635 handleStylePropertyChanged(&QQStyleKitDelegateProperties::topMarginChanged);
638qreal QQStyleKitDelegateProperties::bottomMargin()
const
640 return styleProperty<qreal>(QQSK::Property::BottomMargin, QQSK::Property::Margins);
643void QQStyleKitDelegateProperties::setBottomMargin(qreal margin)
645 if (setStyleProperty(QQSK::Property::BottomMargin, margin))
646 handleStylePropertyChanged(&QQStyleKitDelegateProperties::bottomMarginChanged);
649Qt::Alignment QQStyleKitDelegateProperties::alignment()
const
651 return styleProperty<Qt::Alignment>(QQSK::Property::Alignment, Qt::AlignLeft | Qt::AlignVCenter);
654void QQStyleKitDelegateProperties::setAlignment(Qt::Alignment alignment)
656 if (setStyleProperty(QQSK::Property::Alignment, alignment))
657 handleStylePropertyChanged(&QQStyleKitDelegateProperties::alignmentChanged);
660qreal QQStyleKitDelegateProperties::opacity()
const
662 return styleProperty<qreal>(QQSK::Property::Opacity, 1.0);
665void QQStyleKitDelegateProperties::setOpacity(qreal opacity)
667 if (setStyleProperty(QQSK::Property::Opacity, opacity))
668 handleStylePropertyChanged(&QQStyleKitDelegateProperties::opacityChanged);
671QColor QQStyleKitDelegateProperties::color()
const
673 return styleProperty<QColor>(QQSK::Property::Color, Qt::transparent);
676void QQStyleKitDelegateProperties::setColor(
const QColor &color)
678 if (setStyleProperty(QQSK::Property::Color, color))
679 handleStylePropertyChanged(&QQStyleKitDelegateProperties::colorChanged);
682bool QQStyleKitDelegateProperties::visible()
const
684 return styleProperty<
bool>(QQSK::Property::Visible,
true);
687void QQStyleKitDelegateProperties::setVisible(
bool visible)
689 if (setStyleProperty(QQSK::Property::Visible, visible))
690 handleStylePropertyChanged(&QQStyleKitDelegateProperties::visibleChanged);
693bool QQStyleKitDelegateProperties::clip()
const
695 return styleProperty<
bool>(QQSK::Property::Clip,
false);
698void QQStyleKitDelegateProperties::setClip(
bool clip)
700 if (setStyleProperty(QQSK::Property::Clip, clip))
701 handleStylePropertyChanged(&QQStyleKitDelegateProperties::clipChanged);
704QQuickGradient *QQStyleKitDelegateProperties::gradient()
const
706 return styleProperty<QQuickGradient *>(QQSK::Property::Gradient);
709void QQStyleKitDelegateProperties::setGradient(QQuickGradient *gradient)
711 if (setStyleProperty(QQSK::Property::Gradient, gradient))
712 handleStylePropertyChanged(&QQStyleKitDelegateProperties::gradientChanged);
715QObject *QQStyleKitDelegateProperties::data()
const
717 return styleProperty<QObject *>(QQSK::Property::Data);
720void QQStyleKitDelegateProperties::setData(QObject *data)
722 if (setStyleProperty(QQSK::Property::Data, data))
723 handleStylePropertyChanged(&QQStyleKitDelegateProperties::dataChanged);
726QQmlComponent *QQStyleKitDelegateProperties::delegate()
const
728 return styleProperty<QQmlComponent *>(QQSK::Property::Delegate);
731void QQStyleKitDelegateProperties::setDelegate(QQmlComponent *delegate)
733 if (setStyleProperty(QQSK::Property::Delegate, delegate))
734 handleStylePropertyChanged(&QQStyleKitDelegateProperties::delegateChanged);
737QQStyleKitBorderProperties *QQStyleKitDelegateProperties::border()
const
739 return lazyCreateGroup(m_border, QQSK::PropertyGroup::Border);
742QQStyleKitShadowProperties *QQStyleKitDelegateProperties::shadow()
const
744 return lazyCreateGroup(m_shadow, QQSK::PropertyGroup::Shadow);
747QQStyleKitImageProperties *QQStyleKitDelegateProperties::image()
const
749 return lazyCreateGroup(m_image, QQSK::PropertyGroup::Image);
755 : QQStyleKitDelegateProperties(group, parent)
761 return lazyCreateGroup(m_first, QQSK::PropertyGroup::DelegateSubtype1);
766 return lazyCreateGroup(m_second, QQSK::PropertyGroup::DelegateSubtype2);
773 : QQStyleKitDelegateProperties(group, parent)
777template <
typename... CHANGED_SIGNALS>
779 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
789 return lazyCreateGroup(m_foreground, QQSK::PropertyGroup::Foreground);
796 : QQStyleKitDelegateProperties(group, parent)
800template <
typename... CHANGED_SIGNALS>
802 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
811 return lazyCreateGroup(m_foreground, QQSK::PropertyGroup::Foreground);
816 return lazyCreateGroup(m_up, QQSK::PropertyGroup::DelegateSubtype1);
821 return lazyCreateGroup(m_down, QQSK::PropertyGroup::DelegateSubtype2);
830template <
typename... CHANGED_SIGNALS>
832 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
840 return styleProperty<QColor>(QQSK::Property::Color);
845 if (setStyleProperty(QQSK::Property::Color, color))
846 handleStylePropertyChanged(&QQStyleKitTextProperties::colorChanged);
851 return styleProperty<Qt::Alignment>(QQSK::Property::Alignment);
856 if (setStyleProperty(QQSK::Property::Alignment, alignment))
857 handleStylePropertyChanged(&QQStyleKitTextProperties::alignmentChanged);
862 return styleProperty<
bool>(QQSK::Property::Bold,
false);
867 if (setStyleProperty(QQSK::Property::Bold, bold))
873 return styleProperty<
bool>(QQSK::Property::Italic,
false);
878 if (setStyleProperty(QQSK::Property::Italic, italic))
884 return styleProperty<qreal>(QQSK::Property::PointSize);
889 if (setStyleProperty(QQSK::Property::PointSize, pointSize))
895 return styleProperty<qreal>(QQSK::Property::Padding);
900 if (setStyleProperty(QQSK::Property::Padding, padding))
911 return styleProperty<qreal>(QQSK::Property::LeftPadding, QQSK::Property::Padding);
916 if (setStyleProperty(QQSK::Property::LeftPadding, padding))
922 return styleProperty<qreal>(QQSK::Property::RightPadding, QQSK::Property::Padding);
927 if (setStyleProperty(QQSK::Property::RightPadding, padding))
933 return styleProperty<qreal>(QQSK::Property::TopPadding, QQSK::Property::Padding);
938 if (setStyleProperty(QQSK::Property::TopPadding, padding))
944 return styleProperty<qreal>(QQSK::Property::BottomPadding, QQSK::Property::Padding);
949 if (setStyleProperty(QQSK::Property::BottomPadding, padding))
959
960
961
962
963 m_groupSpace.size = nestedGroupsStartSize;
964 m_groupSpace.start = 0;
966 if (group == QQSK::PropertyGroup::GlobalFlag) {
968
969
970
971
972
973
974 m_pathFlags.setFlag(QQSK::PropertyPathFlag::Global);
980 if (subclass() == QQSK::Subclass::QQStyleKitState) {
982
983
984
985
986
987
988 QObject *obj = parent();
989 while (obj && !obj->metaObject()->inherits(&QQStyleKitStyle::staticMetaObject))
995
996
997
998
1005
1006
1007
1008
1009
1010 if (metaObject()->inherits(&QQStyleKitReader::staticMetaObject))
1011 return QQSK::Subclass::QQStyleKitReader;
1012 if (metaObject()->inherits(&QQStyleKitControlState::staticMetaObject))
1013 return QQSK::Subclass::QQStyleKitState;
1019 Q_ASSERT(subclass() == QQSK::Subclass::QQStyleKitReader);
1020 return static_cast<QQStyleKitReader *>(
const_cast<QQStyleKitControlProperties *>(
this));
1025 Q_ASSERT(subclass() == QQSK::Subclass::QQStyleKitState);
1026 Q_ASSERT(metaObject()->inherits(&QQStyleKitControlState::staticMetaObject));
1027 return static_cast<QQStyleKitControlState *>(
const_cast<QQStyleKitControlProperties *>(
this));
1031 std::function<
void (QQStyleKitDelegateProperties *, QQSK::Delegate,
const QString &)> f)
1035 f(m_background, QQSK::Delegate::Background,
"background"_L1);
1038 f(m_indicator, QQSK::Delegate::Indicator,
"indicator"_L1);
1039 if (m_indicator->m_foreground)
1040 f(m_indicator->m_foreground, QQSK::Delegate::IndicatorForeground,
"indicator.foreground"_L1);
1041 if (m_indicator->m_up) {
1042 f(m_indicator->m_up, QQSK::Delegate::IndicatorUp,
"indicator.up"_L1);
1043 if (m_indicator->m_up->m_foreground)
1044 f(m_indicator->m_up->m_foreground, QQSK::Delegate::IndicatorUpForeground,
"indicator.up.foreground"_L1);
1046 if (m_indicator->m_down) {
1047 f(m_indicator->m_down, QQSK::Delegate::IndicatorDown,
"indicator.down"_L1);
1048 if (m_indicator->m_down->m_foreground)
1049 f(m_indicator->m_down->m_foreground, QQSK::Delegate::IndicatorDownForeground,
"indicator.down.foreground"_L1);
1054 f(m_handle, QQSK::Delegate::Handle,
"handle"_L1);
1055 if (m_handle->m_first)
1056 f(m_handle->m_first, QQSK::Delegate::HandleFirst,
"handle.first"_L1);
1057 if (m_handle->m_second)
1058 f(m_handle->m_second, QQSK::Delegate::HandleSecond,
"handle.second"_L1);
1065
1066
1067 emit leftPaddingChanged();
1068 emit rightPaddingChanged();
1069 emit topPaddingChanged();
1070 emit bottomPaddingChanged();
1071 emit spacingChanged();
1072 emit transitionChanged();
1075 forEachUsedDelegate([](QQStyleKitDelegateProperties *delegate, QQSK::Delegate,
const QString &){
1076 delegate->emitChangedForAllStylePropertiesRecursive();
1080template <
typename... CHANGED_SIGNALS>
1082 QQStyleKitExtendableControlType controlType, CHANGED_SIGNALS... changedSignals)
const
1084 for (QQStyleKitReader *reader : QQStyleKitReader::s_allReaders) {
1085 if (reader->type() != controlType)
1087 ((reader->*changedSignals)(), ...);
1093 return styleProperty<qreal>(QQSK::Property::Spacing);
1098 if (setStyleProperty(QQSK::Property::Spacing, spacing))
1104 return styleProperty<qreal>(QQSK::Property::Padding);
1109 if (setStyleProperty(QQSK::Property::Padding, padding))
1120 return styleProperty<qreal>(QQSK::Property::LeftPadding, QQSK::Property::Padding);
1125 if (setStyleProperty(QQSK::Property::LeftPadding, leftPadding))
1131 return styleProperty<qreal>(QQSK::Property::RightPadding, QQSK::Property::Padding);
1136 if (setStyleProperty(QQSK::Property::RightPadding, rightPadding))
1142 return styleProperty<qreal>(QQSK::Property::TopPadding, QQSK::Property::Padding);
1147 if (setStyleProperty(QQSK::Property::TopPadding, topPadding))
1153 return styleProperty<qreal>(QQSK::Property::BottomPadding, QQSK::Property::Padding);
1158 if (setStyleProperty(QQSK::Property::BottomPadding, bottomPadding))
1164 return styleProperty<QQuickTransition *>(QQSK::Property::Transition);
1169 if (setStyleProperty(QQSK::Property::Transition, transition))
1175 return lazyCreateGroup(m_text, QQSK::PropertyGroup::Text);
1180 return lazyCreateGroup(m_background, QQSK::PropertyGroup::Background);
1185 return lazyCreateGroup(m_handle, QQSK::PropertyGroup::Handle);
1190 return lazyCreateGroup(m_indicator, QQSK::PropertyGroup::Indicator);
1195#include "moc_qqstylekitcontrolproperties_p.cpp"
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 setBottomPadding(qreal bottomPadding)
void setPadding(qreal padding)
void setLeftPadding(qreal leftPadding)
void bottomPaddingChanged()
qreal bottomPadding() const
QQStyleKitControl * control() 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 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
T * lazyCreateGroup(T *const &ptr, QQSK::PropertyGroup group) const
void emitChangedForAllStylePropertiesRecursive()
void handleStylePropertyChanged(void(SUBCLASS::*changedSignal)())
void handleStylePropertiesChanged(CHANGED_SIGNALS... changedSignals)
QQStyleKitControlProperties * controlProperties() const
QString pathToString() const
bool isControlProperties() const
static QQStyleKitStyle * current()
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)
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.
#define CONDITIONALLY_EMIT_SIGNALS_GLOBALLY_FOR(CONTROL_PROPERTIES, GROUP_PATH)