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
qquickitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QQUICKITEM_P_H
6#define QQUICKITEM_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 <QtQuick/private/qquickanchors_p.h>
20#include <QtQuick/private/qquickanchors_p_p.h>
21#include <QtQuick/private/qquickitemchangelistener_p.h>
22#include <QtQuick/private/qquickevents_p_p.h>
23#include <QtQuick/private/qquickclipnode_p.h>
24#include <QtQuick/private/qquickstate_p.h>
25#include <QtQuick/private/qquickpaletteproviderprivatebase_p.h>
26#include <QtQuick/private/qquickwindow_p.h>
27#include <QtCore/private/qproperty_p.h>
28
29#if QT_CONFIG(quick_shadereffect)
30#include <QtQuick/private/qquickshadereffectsource_p.h>
31#endif
32
33#include <QtQuick/qquickitem.h>
34#include <QtQuick/qsgnode.h>
35
36#include <QtQml/private/qqmlnullablevalue_p.h>
37#include <QtQml/private/qqmlnotifier_p.h>
38#include <QtQml/private/qqmlglobal_p.h>
39#include <QtQml/private/qlazilyallocated_p.h>
40#include <QtQml/qqml.h>
41#include <QtQml/qqmlcontext.h>
42
43#include <QtCore/qlist.h>
44#include <QtCore/qdebug.h>
45#include <QtCore/qelapsedtimer.h>
46#include <QtCore/qpointer.h>
47
48#include <QtGui/private/qlayoutpolicy_p.h>
49#if QT_CONFIG(accessibility)
50#include <QtGui/qaccessible_base.h>
51#endif
52
53QT_BEGIN_NAMESPACE
54
55Q_DECLARE_LOGGING_CATEGORY(lcHandlerParent)
56Q_DECLARE_LOGGING_CATEGORY(lcVP)
57
58class QNetworkReply;
59class QQuickItemKeyFilter;
62class QQuickScreenAttached;
63class QQuickPointerHandler;
64
65namespace QtPrivate {
66class QQuickAttachedPropertyPropagator;
67}
68
70{
72public:
75
76 QRectF rectF() const { return m_contents; }
77
78 inline void calcGeometry(QQuickItem *changed = nullptr);
79 void complete();
80
81 bool inDestructor = false;
82
83protected:
84 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override;
85 void itemDestroyed(QQuickItem *item) override;
86 void itemChildAdded(QQuickItem *, QQuickItem *) override;
87 void itemChildRemoved(QQuickItem *, QQuickItem *) override;
88 //void itemVisibilityChanged(QQuickItem *item)
89
90private:
91 bool calcHeight(QQuickItem *changed = nullptr);
92 bool calcWidth(QQuickItem *changed = nullptr);
93 void updateRect();
94
95 QQuickItem *m_item;
96 QRectF m_contents;
97};
98
99void QQuickContents::calcGeometry(QQuickItem *changed)
100{
101 bool wChanged = calcWidth(changed);
102 bool hChanged = calcHeight(changed);
103 if (wChanged || hChanged)
104 updateRect();
105}
106
108{
109 Q_DECLARE_PUBLIC(QQuickTransform)
110public:
112
114
116};
117
118#if QT_CONFIG(quick_shadereffect)
119
120class Q_QUICK_EXPORT QQuickItemLayer : public QObject,
121 public QSafeQuickItemChangeListener<QQuickItemLayer>
122{
123 Q_OBJECT
124 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
125 Q_PROPERTY(QSize textureSize READ size WRITE setSize NOTIFY sizeChanged FINAL)
126 Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged FINAL)
127 Q_PROPERTY(bool mipmap READ mipmap WRITE setMipmap NOTIFY mipmapChanged FINAL)
128 Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged FINAL)
129 Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged REVISION(6, 5) FINAL)
130 Q_PROPERTY(QQuickShaderEffectSource::WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged FINAL)
131 Q_PROPERTY(QQuickShaderEffectSource::Format format READ format WRITE setFormat NOTIFY formatChanged FINAL)
132 Q_PROPERTY(QByteArray samplerName READ name WRITE setName NOTIFY nameChanged FINAL)
133 Q_PROPERTY(QQmlComponent *effect READ effect WRITE setEffect NOTIFY effectChanged FINAL)
134 Q_PROPERTY(QQuickShaderEffectSource::TextureMirroring textureMirroring READ textureMirroring WRITE setTextureMirroring NOTIFY textureMirroringChanged FINAL)
135 Q_PROPERTY(int samples READ samples WRITE setSamples NOTIFY samplesChanged FINAL)
136 QML_ANONYMOUS
137 QML_ADDED_IN_VERSION(2, 0)
138
139public:
140 QQuickItemLayer(QQuickItem *item);
141 ~QQuickItemLayer() override;
142
143 void classBegin();
144 void componentComplete();
145
146 bool enabled() const { return m_enabled; }
147 void setEnabled(bool enabled);
148
149 bool mipmap() const { return m_mipmap; }
150 void setMipmap(bool mipmap);
151
152 bool smooth() const { return m_smooth; }
153 void setSmooth(bool s);
154
155 bool live() const { return m_live; }
156 void setLive(bool live);
157
158 QSize size() const { return m_size; }
159 void setSize(const QSize &size);
160
161 QQuickShaderEffectSource::Format format() const { return m_format; }
162 void setFormat(QQuickShaderEffectSource::Format f);
163
164 QRectF sourceRect() const { return m_sourceRect; }
165 void setSourceRect(const QRectF &sourceRect);
166
167 QQuickShaderEffectSource::WrapMode wrapMode() const { return m_wrapMode; }
168 void setWrapMode(QQuickShaderEffectSource::WrapMode mode);
169
170 QByteArray name() const { return m_name; }
171 void setName(const QByteArray &name);
172
173 QQmlComponent *effect() const { return m_effectComponent; }
174 void setEffect(QQmlComponent *effect);
175
176 QQuickShaderEffectSource::TextureMirroring textureMirroring() const { return m_textureMirroring; }
177 void setTextureMirroring(QQuickShaderEffectSource::TextureMirroring mirroring);
178
179 int samples() const { return m_samples; }
180 void setSamples(int count);
181
182 QQuickShaderEffectSource *effectSource() const { return m_effectSource; }
183
184 void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override;
185 void itemOpacityChanged(QQuickItem *) override;
186 void itemParentChanged(QQuickItem *, QQuickItem *) override;
187 void itemSiblingOrderChanged(QQuickItem *) override;
188 void itemVisibilityChanged(QQuickItem *) override;
189
190 void updateMatrix();
191 void updateGeometry();
192 void updateOpacity();
193 void updateZ();
194
195Q_SIGNALS:
196 void enabledChanged(bool enabled);
197 void sizeChanged(const QSize &size);
198 void mipmapChanged(bool mipmap);
199 void wrapModeChanged(QQuickShaderEffectSource::WrapMode mode);
200 void nameChanged(const QByteArray &name);
201 void effectChanged(QQmlComponent *component);
202 void smoothChanged(bool smooth);
203 void liveChanged(bool live);
204 void formatChanged(QQuickShaderEffectSource::Format format);
205 void sourceRectChanged(const QRectF &sourceRect);
206 void textureMirroringChanged(QQuickShaderEffectSource::TextureMirroring mirroring);
207 void samplesChanged(int count);
208
209private:
210 friend class QQuickTransformAnimatorJob;
211 friend class QQuickOpacityAnimatorJob;
212
213 void activate();
214 void deactivate();
215 void activateEffect();
216 void deactivateEffect();
217
218 QQuickItem *m_item;
219 bool m_enabled;
220 bool m_mipmap;
221 bool m_smooth;
222 bool m_live;
223 bool m_componentComplete;
224 QQuickShaderEffectSource::WrapMode m_wrapMode;
225 QQuickShaderEffectSource::Format m_format;
226 QSize m_size;
227 QRectF m_sourceRect;
228 QByteArray m_name;
229 QQmlComponent *m_effectComponent;
230 QQuickItem *m_effect;
231 QQuickShaderEffectSource *m_effectSource;
232 QQuickShaderEffectSource::TextureMirroring m_textureMirroring;
233 int m_samples;
234};
235
236#endif
237
238class Q_QUICK_EXPORT QQuickItemPrivate
239 : public QObjectPrivate
240 , public QQuickPaletteProviderPrivateBase<QQuickItem, QQuickItemPrivate>
241{
242 Q_DECLARE_PUBLIC(QQuickItem)
243
244public:
245 static QQuickItemPrivate* get(QQuickItem *item) { return item->d_func(); }
246 static const QQuickItemPrivate* get(const QQuickItem *item) { return item->d_func(); }
247
248 QQuickItemPrivate();
249 ~QQuickItemPrivate() override;
250 void init(QQuickItem *parent);
251
252 QQmlListProperty<QObject> data();
253 QQmlListProperty<QObject> resources();
254 QQmlListProperty<QQuickItem> children();
255 QQmlListProperty<QQuickItem> visibleChildren();
256
257 QQmlListProperty<QQuickState> states();
258 QQmlListProperty<QQuickTransition> transitions();
259
260 QString state() const;
261 void setState(const QString &);
262
263 QQuickAnchorLine left() const;
264 QQuickAnchorLine right() const;
265 QQuickAnchorLine horizontalCenter() const;
266 QQuickAnchorLine top() const;
267 QQuickAnchorLine bottom() const;
268 QQuickAnchorLine verticalCenter() const;
269 QQuickAnchorLine baseline() const;
270
271#if QT_CONFIG(quick_shadereffect)
272 QQuickItemLayer *layer() const;
273#endif
274
275 void localizedTouchEvent(const QTouchEvent *event, bool isFiltering, QMutableTouchEvent *localized);
276 bool hasPointerHandlers() const;
277 bool hasEnabledHoverHandlers() const;
278 virtual void addPointerHandler(QQuickPointerHandler *h);
279 virtual void removePointerHandler(QQuickPointerHandler *h);
280
281 QObject *setContextMenu(QObject *menu);
282 QObject *contextMenu() const { return extra.isAllocated() ? extra->contextMenu : nullptr; }
283
284 virtual QtPrivate::QQuickAttachedPropertyPropagator *attachedPropertyPropagator_parent(
285 const QMetaObject *attachedType);
286
287 // data property
288 static void data_append(QQmlListProperty<QObject> *, QObject *);
289 static qsizetype data_count(QQmlListProperty<QObject> *);
290 static QObject *data_at(QQmlListProperty<QObject> *, qsizetype);
291 static void data_clear(QQmlListProperty<QObject> *);
292 static void data_removeLast(QQmlListProperty<QObject> *);
293
294 // resources property
295 static QObject *resources_at(QQmlListProperty<QObject> *, qsizetype);
296 static void resources_append(QQmlListProperty<QObject> *, QObject *);
297 static qsizetype resources_count(QQmlListProperty<QObject> *);
298 static void resources_clear(QQmlListProperty<QObject> *);
299 static void resources_removeLast(QQmlListProperty<QObject> *);
300
301 // children property
302 static void children_append(QQmlListProperty<QQuickItem> *, QQuickItem *);
303 static qsizetype children_count(QQmlListProperty<QQuickItem> *);
304 static QQuickItem *children_at(QQmlListProperty<QQuickItem> *, qsizetype);
305 static void children_clear(QQmlListProperty<QQuickItem> *);
306 static void children_removeLast(QQmlListProperty<QQuickItem> *);
307
308 // visibleChildren property
309 static qsizetype visibleChildren_count(QQmlListProperty<QQuickItem> *prop);
310 static QQuickItem *visibleChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index);
311
312 // transform property
313 static qsizetype transform_count(QQmlListProperty<QQuickTransform> *list);
314 static void transform_append(QQmlListProperty<QQuickTransform> *list, QQuickTransform *);
315 static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, qsizetype);
316 static void transform_clear(QQmlListProperty<QQuickTransform> *list);
317
318 void _q_resourceObjectDeleted(QObject *);
319 quint64 _q_createJSWrapper(QQmlV4ExecutionEnginePtr engine);
320
321 enum ChangeType {
322 Geometry = 0x01,
323 SiblingOrder = 0x02,
324 Visibility = 0x04,
325 Opacity = 0x08,
326 Destroyed = 0x10,
327 Parent = 0x20,
328 Children = 0x40,
329 Rotation = 0x80,
330 ImplicitWidth = 0x100,
331 ImplicitHeight = 0x200,
332 Enabled = 0x400,
333 Focus = 0x800,
334 Scale = 0x1000,
335 Matrix = 0x2000,
336 AllChanges = 0xFFFFFFFF
337 };
338
339 Q_DECLARE_FLAGS(ChangeTypes, ChangeType)
340 friend inline QDebug &operator<<(QDebug &dbg, QQuickItemPrivate::ChangeTypes types) {
341#define CHANGETYPE_OUTPUT(Type) if (types & QQuickItemPrivate::Type) { dbg << first << #Type ; first = '|'; }
342 QDebugStateSaver state(dbg);
343 dbg.noquote().nospace();
344 if (types == QQuickItemPrivate::AllChanges) {
345 dbg << " AllChanges";
346 } else {
347 char first = ' ';
348 CHANGETYPE_OUTPUT(Geometry);
349 CHANGETYPE_OUTPUT(SiblingOrder);
350 CHANGETYPE_OUTPUT(Visibility);
351 CHANGETYPE_OUTPUT(Opacity);
352 CHANGETYPE_OUTPUT(Destroyed);
353 CHANGETYPE_OUTPUT(Parent);
354 CHANGETYPE_OUTPUT(Children);
355 CHANGETYPE_OUTPUT(Rotation);
356 CHANGETYPE_OUTPUT(ImplicitWidth);
357 CHANGETYPE_OUTPUT(ImplicitHeight);
358 CHANGETYPE_OUTPUT(Enabled);
359 CHANGETYPE_OUTPUT(Focus);
360 CHANGETYPE_OUTPUT(Scale);
361 CHANGETYPE_OUTPUT(Matrix);
362#undef CHANGETYPE_OUTPUT
363 }
364 return dbg;
365 }
366
367 struct ChangeListener {
368 using ChangeTypes = QQuickItemPrivate::ChangeTypes;
369
370 ChangeListener(QQuickItemChangeListener *l = nullptr, ChangeTypes t = { })
371 : listener(l)
372 , types(t)
373 , gTypes(QQuickGeometryChange::All)
374 {}
375
376 ChangeListener(QQuickItemChangeListener *l, QQuickGeometryChange gt)
377 : listener(l)
378 , types(Geometry)
379 , gTypes(gt)
380 {}
381
382 bool operator==(const ChangeListener &other) const
383 { return listener == other.listener && types == other.types; }
384
385 QQuickItemChangeListener *listener;
386 ChangeTypes types;
387 QQuickGeometryChange gTypes; //NOTE: not used for ==
388
389#ifndef QT_NO_DEBUG_STREAM
390 private:
391 friend QDebug operator<<(QDebug debug, const QQuickItemPrivate::ChangeListener &listener);
392#endif // QT_NO_DEBUG_STREAM
393 };
394
395 // call QQuickItemChangeListener
396 template <typename Fn, typename ...Args>
397 void notifyChangeListeners(QQuickItemPrivate::ChangeTypes changeTypes, Fn &&function, Args &&...args)
398 {
399 Q_Q(QQuickItem);
400 if (changeListeners.isEmpty())
401 return;
402
403 const auto listeners = changeListeners; // NOTE: intentional copy (QTBUG-54732)
404 for (const QQuickItemPrivate::ChangeListener &change : listeners) {
405 Q_ASSERT(change.listener);
406 if (change.types & changeTypes) {
407#ifdef QT_BUILD_INTERNAL
408 if (changeTypes == AllChanges && change.listener->anchorPrivate() == nullptr) {
409 // Nothing to worry about as long as the lambdas in ~QQuickItem
410 // don't mess around with the change.listener directly!
411 } else if (change.listener->baseDeleted(q)) {
412 auto output = qCritical();
413 output.noquote();
414 output << "Listener already tagged as destroyed when called!"
415 << "\n\tListener:" << change.listener->debugName()
416 << "\n\tChanges:" << change.types
417 << "\n\tCaller: " << q
418 << "\n\tChanges:" << changeTypes;
419 }
420#endif
421 if constexpr (std::is_member_function_pointer_v<Fn>)
422 (change.listener->*function)(args...);
423 else
424 function(change, args...);
425 }
426 if (changeTypes & QQuickItemPrivate::Destroyed)
427 change.listener->removeSourceItem(q);
428 }
429 }
430
431 struct ExtraData {
432 Q_QUICK_EXPORT ExtraData();
433
434 qreal z;
435 qreal scale;
436 qreal rotation;
437 qreal opacity;
438 qreal biggestPointerHandlerMarginCache;
439
440 QQuickContents *contents;
441 QQuickScreenAttached *screenAttached;
442 QQuickLayoutMirroringAttached* layoutDirectionAttached;
443 QQuickEnterKeyAttached *enterKeyAttached;
444 QQuickItemKeyFilter *keyHandler;
445 QList<QQuickPointerHandler *> pointerHandlers;
446 QObject *contextMenu;
447#if QT_CONFIG(quick_shadereffect)
448 mutable QQuickItemLayer *layer;
449#endif
450#if QT_CONFIG(cursor)
451 QCursor cursor;
452#endif
453 QPointF userTransformOriginPoint;
454
455 // these do not include child items
456 int effectRefCount;
457 int hideRefCount;
458 // updated recursively for child items as well
459 int recursiveEffectRefCount;
460 // Mask contains() method index
461 int maskContainsIndex;
462
463 // Contains mask
464 QPointer<QObject> mask;
465
466 QSGOpacityNode *opacityNode;
467 QQuickDefaultClipNode *clipNode;
468 QSGRootNode *rootNode;
469 // subsceneDeliveryAgent is set only if this item is the root of a subscene, not on all items within.
470 QQuickDeliveryAgent *subsceneDeliveryAgent = nullptr;
471
472 QObjectList resourcesList;
473
474 // Although acceptedMouseButtons is inside ExtraData, we actually store
475 // the LeftButton flag in the extra.tag() bit. This is because it is
476 // extremely common to set acceptedMouseButtons to LeftButton, but very
477 // rare to use any of the other buttons.
478 Qt::MouseButtons acceptedMouseButtons;
479 Qt::MouseButtons acceptedMouseButtonsWithoutHandlers;
480
481 uint origin:5; // QQuickItem::TransformOrigin
482 uint transparentForPositioner : 1;
483
484 uint mutabilityGroup : 4;
485 uint mutabilityGroupSet : 1;
486
487 // 21 bits padding
488 };
489
490 enum ExtraDataTag {
491 NoTag = 0x1,
492 LeftMouseButtonAccepted = 0x2
493 };
494 Q_DECLARE_FLAGS(ExtraDataTags, ExtraDataTag)
495
496 QLazilyAllocated<ExtraData, ExtraDataTags> extra;
497 // If the mask is an Item, inform it that it's being used as a mask (true) or is no longer being used (false)
498 virtual void registerAsContainmentMask(QQuickItem * /* maskedItem */, bool /* set */) { }
499
500 QQuickAnchors *anchors() const;
501 mutable QQuickAnchors *_anchors;
502
503 inline Qt::MouseButtons acceptedMouseButtons() const;
504
505 QList<QQuickItemPrivate::ChangeListener> changeListeners;
506
507 void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types);
508 void updateOrAddItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types);
509 void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types);
510 void updateOrAddGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types);
511 void updateOrRemoveGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types);
512
513 QQuickStateGroup *_states();
514 QQuickStateGroup *_stateGroup;
515
516 inline QQuickItem::TransformOrigin origin() const;
517
518 // Bit 0
519 quint32 flags:7;
520 quint32 widthValidFlag:1;
521 quint32 heightValidFlag:1;
522 quint32 componentComplete:1;
523 quint32 keepMouse:1;
524 quint32 keepTouch:1;
525 quint32 hoverEnabled:1;
526 quint32 smooth:1;
527 quint32 antialiasing:1;
528 quint32 focus:1;
529 // Bit 16
530 quint32 activeFocus:1;
531 quint32 notifiedFocus:1;
532 quint32 notifiedActiveFocus:1;
533 quint32 filtersChildMouseEvents:1;
534 quint32 explicitVisible:1;
535 quint32 effectiveVisible:1;
536 quint32 explicitEnable:1;
537 quint32 effectiveEnable:1;
538 quint32 polishScheduled:1;
539 quint32 inheritedLayoutMirror:1;
540 quint32 effectiveLayoutMirror:1;
541 quint32 isMirrorImplicit:1;
542 quint32 inheritMirrorFromParent:1;
543 quint32 inheritMirrorFromItem:1;
544 quint32 isAccessible:1;
545 quint32 culled:1;
546 // Bit 32
547 quint32 hasCursor:1;
548 quint32 subtreeCursorEnabled:1;
549 quint32 subtreeHoverEnabled:1;
550 quint32 activeFocusOnTab:1;
551 quint32 implicitAntialiasing:1;
552 quint32 antialiasingValid:1;
553 // isTabFence: When true, the item acts as a fence within the tab focus chain.
554 // This means that the item and its children will be skipped from the tab focus
555 // chain when navigating from its parent or any of its siblings. Similarly,
556 // when any of the item's descendants gets focus, the item constrains the tab
557 // focus chain and prevents tabbing outside.
558 quint32 isTabFence:1;
559 quint32 replayingPressEvent:1;
560 // Bit 40
561 quint32 touchEnabled:1;
562 quint32 hasCursorHandler:1;
563 // set true when this item does not expect events via a subscene delivery agent; false otherwise
564 quint32 maybeHasSubsceneDeliveryAgent:1;
565 // set true if this item or any child wants QQuickItemPrivate::transformChanged() to visit all children
566 // (e.g. when parent has ItemIsViewport and child has ItemObservesViewport)
567 quint32 subtreeTransformChangedEnabled:1;
568 quint32 inDestructor:1; // has entered ~QQuickItem
569 quint32 focusReason:4;
570 quint32 focusPolicy:4;
571 // Bit 53
572 // eventHandlingChildrenWithinBounds is true if all children recursively
573 // are known to be within their parents' bounds.
574 // eventHandlingChildrenWithinBoundsSet is true only when we've checked.
575 mutable quint32 eventHandlingChildrenWithinBounds:1;
576 mutable quint32 eventHandlingChildrenWithinBoundsSet:1;
577 // Bit 55
578 quint32 customOverlay:1;
579 // Bit 56
580
581 static bool customOverlayRequested;
582 void requestCustomOverlay();
583
584 enum DirtyType {
585 TransformOrigin = 0x00000001,
586 Transform = 0x00000002,
587 BasicTransform = 0x00000004,
588 Position = 0x00000008,
589 Size = 0x00000010,
590
591 ZValue = 0x00000020,
592 Content = 0x00000040,
593 Smooth = 0x00000080,
594 OpacityValue = 0x00000100,
595 ChildrenChanged = 0x00000200,
596 ChildrenStackingChanged = 0x00000400,
597 ParentChanged = 0x00000800,
598
599 Clip = 0x00001000,
600 Window = 0x00002000,
601
602 EffectReference = 0x00008000,
603 Visible = 0x00010000,
604 HideReference = 0x00020000,
605 Antialiasing = 0x00040000,
606 // When you add an attribute here, don't forget to update
607 // dirtyToString()
608
609 TransformUpdateMask = TransformOrigin | Transform | BasicTransform | Position |
610 Window,
611 ComplexTransformUpdateMask = Transform | Window,
612 ContentUpdateMask = Size | Content | Smooth | Window | Antialiasing,
613 ChildrenUpdateMask = ChildrenChanged | ChildrenStackingChanged | EffectReference | Window
614 };
615
616 quint32 dirtyAttributes;
617 QString dirtyToString() const;
618 void dirty(DirtyType);
619 void addToDirtyList();
620 void removeFromDirtyList();
621 QQuickItem *nextDirtyItem;
622 QQuickItem**prevDirtyItem;
623
624 void setCulled(bool);
625
626 QQuickWindow *window;
627 QWindow *renderWindow(QPoint *offset = nullptr) const;
628 int windowRefCount;
629 inline QSGContext *sceneGraphContext() const;
630 inline QSGRenderContext *sceneGraphRenderContext() const;
631
632 QQuickItem *parentItem;
633
634 QList<QQuickItem *> childItems;
635 mutable QList<QQuickItem *> *sortedChildItems;
636 QList<QQuickItem *> paintOrderChildItems() const;
637 void addChild(QQuickItem *);
638 void removeChild(QQuickItem *);
639 void siblingOrderChanged();
640
641 inline void markSortedChildrenDirty(QQuickItem *child);
642
643 void refWindow(QQuickWindow *);
644 void derefWindow();
645
646 qreal effectiveDevicePixelRatio() const;
647
648 QPointer<QQuickItem> subFocusItem;
649 void updateSubFocusItem(QQuickItem *scope, bool focus);
650
651 bool setFocusIfNeeded(QEvent::Type);
652 Qt::FocusReason lastFocusChangeReason() const;
653 virtual bool setLastFocusChangeReason(Qt::FocusReason reason);
654
655 QTransform windowToItemTransform() const;
656 QTransform itemToWindowTransform() const;
657 void itemToParentTransform(QTransform *) const;
658
659 static bool focusNextPrev(QQuickItem *item, bool forward);
660 static QQuickItem *nextTabChildItem(const QQuickItem *item, int start);
661 static QQuickItem *prevTabChildItem(const QQuickItem *item, int start);
662 static QQuickItem *nextPrevItemInTabFocusChain(QQuickItem *item, bool forward, bool wrap = true);
663
664 static bool canAcceptTabFocus(QQuickItem *item);
665
666 void setX(qreal x) {q_func()->setX(x);}
667 void xChanged() { Q_EMIT q_func()->xChanged(); }
668 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, x, &QQuickItemPrivate::setX, &QQuickItemPrivate::xChanged);
669 void setY(qreal y) {q_func()->setY(y);}
670 void yChanged() { Q_EMIT q_func()->yChanged(); }
671 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, y, &QQuickItemPrivate::setY, &QQuickItemPrivate::yChanged);
672 void setWidth(qreal width) {q_func()->setWidth(width);}
673 void widthChanged() { Q_EMIT q_func()->widthChanged(); }
674 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, width, &QQuickItemPrivate::setWidth, &QQuickItemPrivate::widthChanged);
675 void setHeight(qreal height) {q_func()->setHeight(height);}
676 void heightChanged() { Q_EMIT q_func()->heightChanged(); }
677 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, height, &QQuickItemPrivate::setHeight, &QQuickItemPrivate::heightChanged);
678 qreal implicitWidth;
679 qreal implicitHeight;
680
681 bool widthValid() const { return widthValidFlag || (width.hasBinding() && !QQmlPropertyBinding::isUndefined(width.binding()) ); }
682 bool heightValid() const { return heightValidFlag || (height.hasBinding() && !QQmlPropertyBinding::isUndefined(height.binding()) ); }
683
684 qreal baselineOffset;
685
686 QList<QQuickTransform *> transforms;
687
688 inline qreal z() const { return extra.isAllocated()?extra->z:0; }
689 inline qreal scale() const { return extra.isAllocated()?extra->scale:1; }
690 inline qreal rotation() const { return extra.isAllocated()?extra->rotation:0; }
691 inline qreal opacity() const { return extra.isAllocated()?extra->opacity:1; }
692
693 void setAccessible();
694
695 virtual qreal getImplicitWidth() const;
696 virtual qreal getImplicitHeight() const;
697 virtual void implicitWidthChanged();
698 virtual void implicitHeightChanged();
699
700#if QT_CONFIG(accessibility)
701 QAccessible::Role effectiveAccessibleRole() const;
702private:
703 virtual QAccessible::Role accessibleRole() const;
704public:
705#endif
706
707 void setImplicitAntialiasing(bool antialiasing);
708
709 void resolveLayoutMirror();
710 void setImplicitLayoutMirror(bool mirror, bool inherit);
711 void setLayoutMirror(bool mirror);
712 bool isMirrored() const {
713 return effectiveLayoutMirror;
714 }
715
716 void emitChildrenRectChanged(const QRectF &rect) {
717 Q_Q(QQuickItem);
718 Q_EMIT q->childrenRectChanged(rect);
719 }
720
721 QPointF computeTransformOrigin() const;
722 virtual bool transformChanged(QQuickItem *transformedItem);
723
724 QPointF adjustedPosForTransform(const QPointF &centroid,
725 const QPointF &startPos, const QVector2D &activeTranslatation,
726 qreal startScale, qreal activeScale,
727 qreal startRotation, qreal activeRotation);
728
729 QQuickDeliveryAgent *deliveryAgent();
730 QQuickDeliveryAgentPrivate *deliveryAgentPrivate();
731 QQuickDeliveryAgent *ensureSubsceneDeliveryAgent();
732
733 void deliverKeyEvent(QKeyEvent *);
734 bool filterKeyEvent(QKeyEvent *, bool post);
735#if QT_CONFIG(im)
736 void deliverInputMethodEvent(QInputMethodEvent *);
737#endif
738 void deliverShortcutOverrideEvent(QKeyEvent *);
739
740 void deliverPointerEvent(QEvent *);
741
742 bool anyPointerHandlerWants(const QPointerEvent *event, const QEventPoint &point) const;
743 virtual bool handlePointerEvent(QPointerEvent *, bool avoidGrabbers = false);
744#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
745 virtual bool handleContextMenuEvent(QContextMenuEvent *event);
746#endif
747
748 virtual void setVisible(bool visible);
749
750 bool isTransparentForPositioner() const;
751 void setTransparentForPositioner(bool trans);
752
753 bool calcEffectiveVisible() const;
754 bool setEffectiveVisibleRecur(bool);
755 bool calcEffectiveEnable() const;
756 void setEffectiveEnableRecur(QQuickItem *scope, bool);
757
758 qreal biggestPointerHandlerMargin() const;
759 QRectF eventHandlingBounds(qreal margin = 0) const;
760 bool parentFullyContains() const;
761 bool effectivelyClipsEventHandlingChildren() const;
762
763 inline QSGTransformNode *itemNode();
764 inline QSGNode *childContainerNode();
765
766 /*
767 QSGNode order is:
768 - itemNode
769 - (opacityNode)
770 - (clipNode)
771 - (rootNode) (shader effect source's root node)
772 */
773
774 QSGOpacityNode *opacityNode() const { return extra.isAllocated()?extra->opacityNode:nullptr; }
775 QQuickDefaultClipNode *clipNode() const { return extra.isAllocated()?extra->clipNode:nullptr; }
776 QSGRootNode *rootNode() const { return extra.isAllocated()?extra->rootNode:nullptr; }
777
778 QSGTransformNode *itemNodeInstance;
779 QSGNode *paintNode;
780
781 virtual QSGTransformNode *createTransformNode();
782
783 // A reference from an effect item means that this item is used by the effect, so
784 // it should insert a root node.
785 void refFromEffectItem(bool hide);
786 void recursiveRefFromEffectItem(int refs);
787 void derefFromEffectItem(bool unhide);
788
789 void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &);
790
791 void enableSubtreeChangeNotificationsForParentHierachy();
792
793 virtual void mirrorChange() {}
794
795 void setHasCursorInChild(bool hasCursor);
796 void setHasHoverInChild(bool hasHover);
797#if QT_CONFIG(cursor)
798 QCursor effectiveCursor(const QQuickPointerHandler *handler) const;
799 QQuickPointerHandler *effectiveCursorHandler() const;
800#endif
801
802 virtual void updatePolish() { }
803 virtual void dumpItemTree(int indent) const;
804
805 QLayoutPolicy sizePolicy() const;
806 void setSizePolicy(const QLayoutPolicy::Policy &horizontalPolicy, const QLayoutPolicy::Policy &verticalPolicy);
807 QLayoutPolicy szPolicy;
808
809#ifdef QT_BUILD_INTERNAL
810 static quint32 item_counter;
811 static quint32 itemExtra_counter;
812 static quint32 eventHandlingChildrenWithinBounds_counter;
813 static quint64 itemToParentTransform_counter;
814 static quint64 itemToWindowTransform_counter;
815 static quint64 windowToItemTransform_counter;
816 static quint64 effectiveClippingSkips_counter;
817#endif
818};
819
820Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickItemPrivate::ExtraDataTags)
821
822/*
823 Key filters can be installed on a QQuickItem, but not removed. Currently they
824 are only used by attached objects (which are only destroyed on Item
825 destruction), so this isn't a problem. If in future this becomes any form
826 of public API, they will have to support removal too.
827*/
828class QQuickItemKeyFilter
829{
830public:
831 QQuickItemKeyFilter(QQuickItem * = nullptr);
832 virtual ~QQuickItemKeyFilter();
833
834 virtual void keyPressed(QKeyEvent *event, bool post);
835 virtual void keyReleased(QKeyEvent *event, bool post);
836#if QT_CONFIG(im)
837 virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
838 virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
839#endif
840 virtual void shortcutOverrideEvent(QKeyEvent *event);
841 virtual void componentComplete();
842
843 bool m_processPost;
844
845private:
846 QQuickItemKeyFilter *m_next;
847};
848
869
870class Q_QUICK_EXPORT QQuickKeyNavigationAttached : public QObject, public QQuickItemKeyFilter
871{
872 Q_OBJECT
873 Q_DECLARE_PRIVATE(QQuickKeyNavigationAttached)
874
875 Q_PROPERTY(QQuickItem *left READ left WRITE setLeft NOTIFY leftChanged FINAL)
876 Q_PROPERTY(QQuickItem *right READ right WRITE setRight NOTIFY rightChanged FINAL)
877 Q_PROPERTY(QQuickItem *up READ up WRITE setUp NOTIFY upChanged FINAL)
878 Q_PROPERTY(QQuickItem *down READ down WRITE setDown NOTIFY downChanged FINAL)
879 Q_PROPERTY(QQuickItem *tab READ tab WRITE setTab NOTIFY tabChanged FINAL)
880 Q_PROPERTY(QQuickItem *backtab READ backtab WRITE setBacktab NOTIFY backtabChanged FINAL)
881 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged FINAL)
882
883 QML_NAMED_ELEMENT(KeyNavigation)
884 QML_ADDED_IN_VERSION(2, 0)
885 QML_UNCREATABLE("KeyNavigation is only available via attached properties.")
886 QML_ATTACHED(QQuickKeyNavigationAttached)
887
888public:
889 QQuickKeyNavigationAttached(QObject * = nullptr);
890
891 QQuickItem *left() const;
892 void setLeft(QQuickItem *);
893 QQuickItem *right() const;
894 void setRight(QQuickItem *);
895 QQuickItem *up() const;
896 void setUp(QQuickItem *);
897 QQuickItem *down() const;
898 void setDown(QQuickItem *);
899 QQuickItem *tab() const;
900 void setTab(QQuickItem *);
901 QQuickItem *backtab() const;
902 void setBacktab(QQuickItem *);
903
904 enum Priority { BeforeItem, AfterItem };
905 Q_ENUM(Priority)
906 Priority priority() const;
907 void setPriority(Priority);
908
909 static QQuickKeyNavigationAttached *qmlAttachedProperties(QObject *);
910
911Q_SIGNALS:
912 void leftChanged();
913 void rightChanged();
914 void upChanged();
915 void downChanged();
916 void tabChanged();
917 void backtabChanged();
918 void priorityChanged();
919
920private:
921 void keyPressed(QKeyEvent *event, bool post) override;
922 void keyReleased(QKeyEvent *event, bool post) override;
923 void setFocusNavigation(QQuickItem *currentItem, const char *dir,
924 Qt::FocusReason reason = Qt::OtherFocusReason);
925};
926
928{
929 Q_OBJECT
930 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged FINAL)
932
935 QML_UNCREATABLE("LayoutMirroring is only available via attached properties.")
937
938public:
939 explicit QQuickLayoutMirroringAttached(QObject *parent = nullptr);
940
941 bool enabled() const;
942 void setEnabled(bool);
943 void resetEnabled();
944
945 bool childrenInherit() const;
946 void setChildrenInherit(bool);
947
952private:
953 friend class QQuickItemPrivate;
954 QQuickItemPrivate *itemPrivate;
955};
956
958{
959 Q_OBJECT
960 Q_PROPERTY(Qt::EnterKeyType type READ type WRITE setType NOTIFY typeChanged FINAL)
961
963 QML_UNCREATABLE("EnterKey is only available via attached properties")
966
967public:
968 explicit QQuickEnterKeyAttached(QObject *parent = nullptr);
969
970 Qt::EnterKeyType type() const;
971 void setType(Qt::EnterKeyType type);
972
976private:
977 friend class QQuickItemPrivate;
978 QQuickItemPrivate *itemPrivate;
979
980 Qt::EnterKeyType keyType;
981};
982
984{
985public:
987 : inPress(false), inRelease(false), inIM(false), enabled(true)
988 {}
989
990 //loop detection
991 bool inPress:1;
992 bool inRelease:1;
993 bool inIM:1;
994
995 bool enabled : 1;
996
997 QQuickItem *imeItem = nullptr;
999 QQuickItem *item = nullptr;
1001};
1002
1003class Q_QUICK_EXPORT QQuickKeysAttached : public QObject, public QQuickItemKeyFilter
1004{
1005 Q_OBJECT
1006 Q_DECLARE_PRIVATE(QQuickKeysAttached)
1007
1008 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
1009 Q_PROPERTY(QQmlListProperty<QQuickItem> forwardTo READ forwardTo FINAL)
1010 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged FINAL)
1011
1012 QML_NAMED_ELEMENT(Keys)
1013 QML_ADDED_IN_VERSION(2, 0)
1014 QML_UNCREATABLE("Keys is only available via attached properties")
1015 QML_ATTACHED(QQuickKeysAttached)
1016
1017public:
1018 QQuickKeysAttached(QObject *parent=nullptr);
1019 ~QQuickKeysAttached() override;
1020
1021 bool enabled() const { Q_D(const QQuickKeysAttached); return d->enabled; }
1022 void setEnabled(bool enabled) {
1023 Q_D(QQuickKeysAttached);
1024 if (enabled != d->enabled) {
1025 d->enabled = enabled;
1026 Q_EMIT enabledChanged();
1027 }
1028 }
1029
1030 enum Priority { BeforeItem, AfterItem};
1031 Q_ENUM(Priority)
1032 Priority priority() const;
1033 void setPriority(Priority);
1034
1035 QQmlListProperty<QQuickItem> forwardTo() {
1036 Q_D(QQuickKeysAttached);
1037 return QQmlListProperty<QQuickItem>(this, &(d->targets));
1038 }
1039
1040 void componentComplete() override;
1041
1042 static QQuickKeysAttached *qmlAttachedProperties(QObject *);
1043
1044Q_SIGNALS:
1045 void enabledChanged();
1046 void priorityChanged();
1047 void pressed(QQuickKeyEvent *event);
1048 void released(QQuickKeyEvent *event);
1049 void shortcutOverride(QQuickKeyEvent *event);
1050 void digit0Pressed(QQuickKeyEvent *event);
1051 void digit1Pressed(QQuickKeyEvent *event);
1052 void digit2Pressed(QQuickKeyEvent *event);
1053 void digit3Pressed(QQuickKeyEvent *event);
1054 void digit4Pressed(QQuickKeyEvent *event);
1055 void digit5Pressed(QQuickKeyEvent *event);
1056 void digit6Pressed(QQuickKeyEvent *event);
1057 void digit7Pressed(QQuickKeyEvent *event);
1058 void digit8Pressed(QQuickKeyEvent *event);
1059 void digit9Pressed(QQuickKeyEvent *event);
1060
1061 void leftPressed(QQuickKeyEvent *event);
1062 void rightPressed(QQuickKeyEvent *event);
1063 void upPressed(QQuickKeyEvent *event);
1064 void downPressed(QQuickKeyEvent *event);
1065 void tabPressed(QQuickKeyEvent *event);
1066 void backtabPressed(QQuickKeyEvent *event);
1067
1068 void asteriskPressed(QQuickKeyEvent *event);
1069 void numberSignPressed(QQuickKeyEvent *event);
1070 void escapePressed(QQuickKeyEvent *event);
1071 void returnPressed(QQuickKeyEvent *event);
1072 void enterPressed(QQuickKeyEvent *event);
1073 void deletePressed(QQuickKeyEvent *event);
1074 void spacePressed(QQuickKeyEvent *event);
1075 void backPressed(QQuickKeyEvent *event);
1076 void cancelPressed(QQuickKeyEvent *event);
1077 void selectPressed(QQuickKeyEvent *event);
1078 void yesPressed(QQuickKeyEvent *event);
1079 void noPressed(QQuickKeyEvent *event);
1080 void context1Pressed(QQuickKeyEvent *event);
1081 void context2Pressed(QQuickKeyEvent *event);
1082 void context3Pressed(QQuickKeyEvent *event);
1083 void context4Pressed(QQuickKeyEvent *event);
1084 void callPressed(QQuickKeyEvent *event);
1085 void hangupPressed(QQuickKeyEvent *event);
1086 void flipPressed(QQuickKeyEvent *event);
1087 void menuPressed(QQuickKeyEvent *event);
1088 void volumeUpPressed(QQuickKeyEvent *event);
1089 void volumeDownPressed(QQuickKeyEvent *event);
1090
1091private:
1092 void keyPressed(QKeyEvent *event, bool post) override;
1093 void keyReleased(QKeyEvent *event, bool post) override;
1094#if QT_CONFIG(im)
1095 void inputMethodEvent(QInputMethodEvent *, bool post) override;
1096 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
1097#endif
1098 void shortcutOverrideEvent(QKeyEvent *event) override;
1099 static QByteArray keyToSignal(int key);
1100
1101 bool isConnected(const char *signalName) const;
1102};
1103
1104Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const
1105{
1106 return ((extra.tag().testFlag(LeftMouseButtonAccepted) ? Qt::LeftButton : Qt::MouseButton(0)) |
1107 (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons{}));
1108}
1109
1110QSGContext *QQuickItemPrivate::sceneGraphContext() const
1111{
1112 Q_ASSERT(window);
1113 return static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(window))->context->sceneGraphContext();
1114}
1115
1116QSGRenderContext *QQuickItemPrivate::sceneGraphRenderContext() const
1117{
1118 Q_ASSERT(window);
1119 return static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(window))->context;
1120}
1121
1122void QQuickItemPrivate::markSortedChildrenDirty(QQuickItem *child)
1123{
1124 // If sortedChildItems == &childItems then all in childItems have z == 0
1125 // and we don't need to invalidate if the changed item also has z == 0.
1126 if (child->z() != 0. || sortedChildItems != &childItems) {
1127 if (sortedChildItems != &childItems)
1128 delete sortedChildItems;
1129 sortedChildItems = nullptr;
1130 }
1131}
1132
1133QQuickItem::TransformOrigin QQuickItemPrivate::origin() const
1134{
1135 return extra.isAllocated() ? QQuickItem::TransformOrigin(extra->origin)
1136 : QQuickItem::Center;
1137}
1138
1139QSGTransformNode *QQuickItemPrivate::itemNode()
1140{
1141 if (!itemNodeInstance) {
1142 itemNodeInstance = createTransformNode();
1143 itemNodeInstance->setFlag(QSGNode::OwnedByParent, false);
1144#ifdef QSG_RUNTIME_DESCRIPTION
1145 Q_Q(QQuickItem);
1146 qsgnode_set_description(itemNodeInstance, QString::fromLatin1("QQuickItem(%1:%2)").arg(QString::fromLatin1(q->metaObject()->className())).arg(q->objectName()));
1147#endif
1148 }
1149 return itemNodeInstance;
1150}
1151
1152QSGNode *QQuickItemPrivate::childContainerNode()
1153{
1154 if (rootNode())
1155 return rootNode();
1156 else if (clipNode())
1157 return clipNode();
1158 else if (opacityNode())
1159 return opacityNode();
1160 else
1161 return itemNode();
1162}
1163
1164Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickItemPrivate::ChangeTypes)
1165Q_DECLARE_TYPEINFO(QQuickItemPrivate::ChangeListener, Q_PRIMITIVE_TYPE);
1166
1167QT_END_NAMESPACE
1168
1169#endif // QQUICKITEM_P_H
bool checkHAnchorValid(QQuickAnchorLine anchor) const
bool isItemComplete() const
void remDepend(QQuickItem *)
QQuickGeometryChange calculateDependency(QQuickItem *) const
bool checkVAnchorValid(QQuickAnchorLine anchor) const
void addDepend(QQuickItem *)
void setItemSize(const QSizeF &)
static QQuickAnchorsPrivate * get(QQuickAnchors *o)
void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override
bool isMirrored() const
QQuickItem * baselineAnchorItem
QQuickAnchorsPrivate * anchorPrivate() override
bool calcStretch(QQuickItem *edge1Item, QQuickAnchors::Anchor edge1Line, QQuickItem *edge2Item, QQuickAnchors::Anchor edge2Line, qreal offset1, qreal offset2, QQuickAnchors::Anchor line, qreal &stretch) const
void setItemPos(const QPointF &)
~QQuickContents() override
void calcGeometry(QQuickItem *changed=nullptr)
void itemChildRemoved(QQuickItem *, QQuickItem *) override
void itemChildAdded(QQuickItem *, QQuickItem *) override
QRectF rectF() const
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override
void itemDestroyed(QQuickItem *item) override
void setType(Qt::EnterKeyType type)
Qt::EnterKeyType type() const
static QQuickEnterKeyAttached * qmlAttachedProperties(QObject *)
bool matches(QQuickGeometryChange other) const
void set(int bits, bool enabled)
QQuickGeometryChange(int change=Nothing)
void setVerticalChange(bool enabled)
void setHorizontalChange(bool enabled)
QPointer< QQuickItem > backtab
QList< QQuickItem * > targets
static QQuickLayoutMirroringAttached * qmlAttachedProperties(QObject *)
QList< QQuickItem * > items
bool baseDeleted(const QObject *caller) const override
decltype(T::inDestructor) InDestructorTest
Combined button and popup list for selecting options.
static qreal hcenter(const QQuickItem *item)
static qreal vcenter(const QQuickItem *item)
static QQuickAnchors::Anchor reverseAnchorLine(QQuickAnchors::Anchor anchorLine)
static qreal adjustedPosition(QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QQuickAnchorLine &a, const QQuickAnchorLine &b)
#define CHANGETYPE_OUTPUT(Type)