40 public QSafeQuickItemChangeListener<QQuickControlPrivate>
41#if QT_CONFIG(accessibility)
42 ,
public QAccessible::ActivationObserver
46 Q_DECLARE_PUBLIC(QQuickControl)
48 QQuickControlPrivate();
49 ~QQuickControlPrivate();
51 static QQuickControlPrivate *get(QQuickControl *control)
53 return control->d_func();
58#if QT_CONFIG(quicktemplates2_multitouch)
59 virtual bool acceptTouch(
const QTouchEvent::TouchPoint &point);
61 virtual bool handlePress(
const QPointF &point, ulong timestamp);
62 virtual bool handleMove(
const QPointF &point, ulong timestamp);
63 virtual bool handleRelease(
const QPointF &point, ulong timestamp);
64 virtual void handleUngrab();
66 void mirrorChange() override;
68 inline QMarginsF getPadding()
const {
return QMarginsF(getLeftPadding(), getTopPadding(), getRightPadding(), getBottomPadding()); }
69 inline qreal getTopPadding()
const {
return extra.isAllocated() && extra->hasTopPadding ? extra->topPadding : getVerticalPadding(); }
70 inline qreal getLeftPadding()
const {
return extra.isAllocated() && extra->hasLeftPadding ? extra->leftPadding : getHorizontalPadding(); }
71 inline qreal getRightPadding()
const {
return extra.isAllocated() && extra->hasRightPadding ? extra->rightPadding : getHorizontalPadding(); }
72 inline qreal getBottomPadding()
const {
return extra.isAllocated() && extra->hasBottomPadding ? extra->bottomPadding : getVerticalPadding(); }
73 inline qreal getHorizontalPadding()
const {
return hasHorizontalPadding ? horizontalPadding : padding; }
74 inline qreal getVerticalPadding()
const {
return hasVerticalPadding ? verticalPadding : padding; }
76 void setTopPadding(qreal value,
bool reset =
false);
77 void setLeftPadding(qreal value,
bool reset =
false);
78 void setRightPadding(qreal value,
bool reset =
false);
79 void setBottomPadding(qreal value,
bool reset =
false);
80 void setHorizontalPadding(qreal value,
bool reset =
false);
81 void setVerticalPadding(qreal value,
bool reset =
false);
83 inline QMarginsF getInset()
const {
return QMarginsF(getLeftInset(), getTopInset(), getRightInset(), getBottomInset()); }
84 inline qreal getTopInset()
const {
return extra.isAllocated() ? extra->topInset : 0; }
85 inline qreal getLeftInset()
const {
return extra.isAllocated() ? extra->leftInset : 0; }
86 inline qreal getRightInset()
const {
return extra.isAllocated() ? extra->rightInset : 0; }
87 inline qreal getBottomInset()
const {
return extra.isAllocated() ? extra->bottomInset : 0; }
89 void setTopInset(qreal value,
bool reset =
false);
90 void setLeftInset(qreal value,
bool reset =
false);
91 void setRightInset(qreal value,
bool reset =
false);
92 void setBottomInset(qreal value,
bool reset =
false);
94 virtual void resizeBackground();
95 virtual void resizeContent();
97 virtual QQuickItem *getContentItem();
98 void setContentItem_helper(QQuickItem *item,
bool notify =
true);
100#if QT_CONFIG(accessibility)
101 void accessibilityActiveChanged(
bool active) override;
102 QAccessible::Role accessibleRole()
const override;
103 static QQuickAccessibleAttached *accessibleAttached(
const QObject *object);
106 virtual void resolveFont();
107 void inheritFont(
const QFont &font);
108 void updateFont(
const QFont &font);
109 static void updateFontRecur(QQuickItem *item,
const QFont &font);
110 inline void setFont_helper(
const QFont &font) {
111 if (resolvedFont.resolveMask() == font.resolveMask() && resolvedFont == font)
115 static QFont parentFont(
const QQuickItem *item);
117 void updateLocale(
const QLocale &l,
bool e);
118 static void updateLocaleRecur(QQuickItem *item,
const QLocale &l);
119 static QLocale calcLocale(
const QQuickItem *item);
121#if QT_CONFIG(quicktemplates2_hover)
122 void updateHoverEnabled(
bool enabled,
bool xplicit);
123 static void updateHoverEnabledRecur(QQuickItem *item,
bool enabled);
124 static bool calcHoverEnabled(
const QQuickItem *item);
127 static void warnIfCustomizationNotSupported(QObject *control, QQuickItem *item,
const QString &propertyName);
129 virtual void cancelContentItem();
130 virtual void executeContentItem(
bool complete =
false);
132 virtual void cancelBackground();
133 virtual void executeBackground(
bool complete =
false);
135 enum class UnhideVisibility {
140 static void hideOldItem(QQuickItem *item);
141 static void unhideOldItem(QQuickControl *control, QQuickItem *item,
142 UnhideVisibility visibility = UnhideVisibility::Show);
144 void updateBaselineOffset();
146 static const ChangeTypes ImplicitSizeChanges;
148 void addImplicitSizeListener(QQuickItem *item, ChangeTypes changes = ImplicitSizeChanges);
149 void removeImplicitSizeListener(QQuickItem *item, ChangeTypes changes = ImplicitSizeChanges);
151 static void addImplicitSizeListener(QQuickItem *item, QQuickItemChangeListener *listener, ChangeTypes changes = ImplicitSizeChanges);
152 static void removeImplicitSizeListener(QQuickItem *item, QQuickItemChangeListener *listener, ChangeTypes changes = ImplicitSizeChanges);
154 void itemImplicitWidthChanged(QQuickItem *item) override;
155 void itemImplicitHeightChanged(QQuickItem *item) override;
156 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change,
const QRectF &diff) override;
157 void itemDestroyed(QQuickItem *item) override;
158 void itemFocusChanged(QQuickItem *item, Qt::FocusReason reason) override;
160 bool setLastFocusChangeReason(Qt::FocusReason) override;
162 virtual qreal getContentWidth()
const;
163 virtual qreal getContentHeight()
const;
165 void updateImplicitContentWidth();
166 void updateImplicitContentHeight();
167 void updateImplicitContentSize();
169 QPalette defaultPalette()
const override;
172 bool hasTopPadding =
false;
173 bool hasLeftPadding =
false;
174 bool hasRightPadding =
false;
175 bool hasBottomPadding =
false;
176 bool hasBaselineOffset =
false;
177 bool hasTopInset =
false;
178 bool hasLeftInset =
false;
179 bool hasRightInset =
false;
180 bool hasBottomInset =
false;
181 bool hasBackgroundWidth =
false;
182 bool hasBackgroundHeight =
false;
183 qreal topPadding = 0;
184 qreal leftPadding = 0;
185 qreal rightPadding = 0;
186 qreal bottomPadding = 0;
189 qreal rightInset = 0;
190 qreal bottomInset = 0;
193 QLazilyAllocated<ExtraData> extra;
195 bool hasHorizontalPadding =
false;
196 bool hasVerticalPadding =
false;
197 bool hasLocale =
false;
198 bool wheelEnabled =
false;
199#if QT_CONFIG(quicktemplates2_hover)
200 bool hovered =
false;
201 bool explicitHoverEnabled =
false;
203 bool resizingBackground =
false;
206 qreal horizontalPadding = 0;
207 qreal verticalPadding = 0;
208 qreal implicitContentWidth = 0;
209 qreal implicitContentHeight = 0;
213 QQuickDeferredPointer<QQuickItem> background;
214 QQuickDeferredPointer<QQuickItem> contentItem;