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
283 virtual QtPrivate::QQuickAttachedPropertyPropagator *attachedPropertyPropagator_parent(
284 const QMetaObject *attachedType);
285
286 // data property
287 static void data_append(QQmlListProperty<QObject> *, QObject *);
288 static qsizetype data_count(QQmlListProperty<QObject> *);
289 static QObject *data_at(QQmlListProperty<QObject> *, qsizetype);
290 static void data_clear(QQmlListProperty<QObject> *);
291 static void data_removeLast(QQmlListProperty<QObject> *);
292
293 // resources property
294 static QObject *resources_at(QQmlListProperty<QObject> *, qsizetype);
295 static void resources_append(QQmlListProperty<QObject> *, QObject *);
296 static qsizetype resources_count(QQmlListProperty<QObject> *);
297 static void resources_clear(QQmlListProperty<QObject> *);
298 static void resources_removeLast(QQmlListProperty<QObject> *);
299
300 // children property
301 static void children_append(QQmlListProperty<QQuickItem> *, QQuickItem *);
302 static qsizetype children_count(QQmlListProperty<QQuickItem> *);
303 static QQuickItem *children_at(QQmlListProperty<QQuickItem> *, qsizetype);
304 static void children_clear(QQmlListProperty<QQuickItem> *);
305 static void children_removeLast(QQmlListProperty<QQuickItem> *);
306
307 // visibleChildren property
308 static qsizetype visibleChildren_count(QQmlListProperty<QQuickItem> *prop);
309 static QQuickItem *visibleChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index);
310
311 // transform property
312 static qsizetype transform_count(QQmlListProperty<QQuickTransform> *list);
313 static void transform_append(QQmlListProperty<QQuickTransform> *list, QQuickTransform *);
314 static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, qsizetype);
315 static void transform_clear(QQmlListProperty<QQuickTransform> *list);
316
317 void _q_resourceObjectDeleted(QObject *);
318 quint64 _q_createJSWrapper(QQmlV4ExecutionEnginePtr engine);
319
320 enum ChangeType {
321 Geometry = 0x01,
322 SiblingOrder = 0x02,
323 Visibility = 0x04,
324 Opacity = 0x08,
325 Destroyed = 0x10,
326 Parent = 0x20,
327 Children = 0x40,
328 Rotation = 0x80,
329 ImplicitWidth = 0x100,
330 ImplicitHeight = 0x200,
331 Enabled = 0x400,
332 Focus = 0x800,
333 Scale = 0x1000,
334 Matrix = 0x2000,
335 AllChanges = 0xFFFFFFFF
336 };
337
338 Q_DECLARE_FLAGS(ChangeTypes, ChangeType)
339 friend inline QDebug &operator<<(QDebug &dbg, QQuickItemPrivate::ChangeTypes types) {
340#define CHANGETYPE_OUTPUT(Type) if (types & QQuickItemPrivate::Type) { dbg << first << #Type ; first = '|'; }
341 QDebugStateSaver state(dbg);
342 dbg.noquote().nospace();
343 if (types == QQuickItemPrivate::AllChanges) {
344 dbg << " AllChanges";
345 } else {
346 char first = ' ';
347 CHANGETYPE_OUTPUT(Geometry);
348 CHANGETYPE_OUTPUT(SiblingOrder);
349 CHANGETYPE_OUTPUT(Visibility);
350 CHANGETYPE_OUTPUT(Opacity);
351 CHANGETYPE_OUTPUT(Destroyed);
352 CHANGETYPE_OUTPUT(Parent);
353 CHANGETYPE_OUTPUT(Children);
354 CHANGETYPE_OUTPUT(Rotation);
355 CHANGETYPE_OUTPUT(ImplicitWidth);
356 CHANGETYPE_OUTPUT(ImplicitHeight);
357 CHANGETYPE_OUTPUT(Enabled);
358 CHANGETYPE_OUTPUT(Focus);
359 CHANGETYPE_OUTPUT(Scale);
360 CHANGETYPE_OUTPUT(Matrix);
361#undef CHANGETYPE_OUTPUT
362 }
363 return dbg;
364 }
365
366 struct ChangeListener {
367 using ChangeTypes = QQuickItemPrivate::ChangeTypes;
368
369 ChangeListener(QQuickItemChangeListener *l = nullptr, ChangeTypes t = { })
370 : listener(l)
371 , types(t)
372 , gTypes(QQuickGeometryChange::All)
373 {}
374
375 ChangeListener(QQuickItemChangeListener *l, QQuickGeometryChange gt)
376 : listener(l)
377 , types(Geometry)
378 , gTypes(gt)
379 {}
380
381 bool operator==(const ChangeListener &other) const
382 { return listener == other.listener && types == other.types; }
383
384 QQuickItemChangeListener *listener;
385 ChangeTypes types;
386 QQuickGeometryChange gTypes; //NOTE: not used for ==
387
388#ifndef QT_NO_DEBUG_STREAM
389 private:
390 friend QDebug operator<<(QDebug debug, const QQuickItemPrivate::ChangeListener &listener);
391#endif // QT_NO_DEBUG_STREAM
392 };
393
394 // call QQuickItemChangeListener
395 template <typename Fn, typename ...Args>
396 void notifyChangeListeners(QQuickItemPrivate::ChangeTypes changeTypes, Fn &&function, Args &&...args)
397 {
398 Q_Q(QQuickItem);
399 if (changeListeners.isEmpty())
400 return;
401
402 const auto listeners = changeListeners; // NOTE: intentional copy (QTBUG-54732)
403 for (const QQuickItemPrivate::ChangeListener &change : listeners) {
404 Q_ASSERT(change.listener);
405 if (change.types & changeTypes) {
406#ifdef QT_BUILD_INTERNAL
407 if (changeTypes == AllChanges && change.listener->anchorPrivate() == nullptr) {
408 // Nothing to worry about as long as the lambdas in ~QQuickItem
409 // don't mess around with the change.listener directly!
410 } else if (change.listener->baseDeleted(q)) {
411 auto output = qCritical();
412 output.noquote();
413 output << "Listener already tagged as destroyed when called!"
414 << "\n\tListener:" << change.listener->debugName()
415 << "\n\tChanges:" << change.types
416 << "\n\tCaller: " << q
417 << "\n\tChanges:" << changeTypes;
418 }
419#endif
420 if constexpr (std::is_member_function_pointer_v<Fn>)
421 (change.listener->*function)(args...);
422 else
423 function(change, args...);
424 }
425 if (changeTypes & QQuickItemPrivate::Destroyed)
426 change.listener->removeSourceItem(q);
427 }
428 }
429
430 struct ExtraData {
431 Q_QUICK_EXPORT ExtraData();
432
433 qreal z;
434 qreal scale;
435 qreal rotation;
436 qreal opacity;
437 qreal biggestPointerHandlerMarginCache;
438
439 QQuickContents *contents;
440 QQuickScreenAttached *screenAttached;
441 QQuickLayoutMirroringAttached* layoutDirectionAttached;
442 QQuickEnterKeyAttached *enterKeyAttached;
443 QQuickItemKeyFilter *keyHandler;
444 QList<QQuickPointerHandler *> pointerHandlers;
445 QObject *contextMenu;
446#if QT_CONFIG(quick_shadereffect)
447 mutable QQuickItemLayer *layer;
448#endif
449#if QT_CONFIG(cursor)
450 QCursor cursor;
451#endif
452 QPointF userTransformOriginPoint;
453
454 // these do not include child items
455 int effectRefCount;
456 int hideRefCount;
457 // updated recursively for child items as well
458 int recursiveEffectRefCount;
459 // Mask contains() method index
460 int maskContainsIndex;
461
462 // Contains mask
463 QPointer<QObject> mask;
464
465 QSGOpacityNode *opacityNode;
466 QQuickDefaultClipNode *clipNode;
467 QSGRootNode *rootNode;
468 // subsceneDeliveryAgent is set only if this item is the root of a subscene, not on all items within.
469 QQuickDeliveryAgent *subsceneDeliveryAgent = nullptr;
470
471 QObjectList resourcesList;
472
473 // Although acceptedMouseButtons is inside ExtraData, we actually store
474 // the LeftButton flag in the extra.tag() bit. This is because it is
475 // extremely common to set acceptedMouseButtons to LeftButton, but very
476 // rare to use any of the other buttons.
477 Qt::MouseButtons acceptedMouseButtons;
478 Qt::MouseButtons acceptedMouseButtonsWithoutHandlers;
479
480 uint origin:5; // QQuickItem::TransformOrigin
481 uint transparentForPositioner : 1;
482
483 uint mutabilityGroup : 4;
484 uint mutabilityGroupSet : 1;
485
486 // 21 bits padding
487 };
488
489 enum ExtraDataTag {
490 NoTag = 0x1,
491 LeftMouseButtonAccepted = 0x2
492 };
493 Q_DECLARE_FLAGS(ExtraDataTags, ExtraDataTag)
494
495 QLazilyAllocated<ExtraData, ExtraDataTags> extra;
496 // If the mask is an Item, inform it that it's being used as a mask (true) or is no longer being used (false)
497 virtual void registerAsContainmentMask(QQuickItem * /* maskedItem */, bool /* set */) { }
498
499 QQuickAnchors *anchors() const;
500 mutable QQuickAnchors *_anchors;
501
502 inline Qt::MouseButtons acceptedMouseButtons() const;
503
504 QList<QQuickItemPrivate::ChangeListener> changeListeners;
505
506 void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types);
507 void updateOrAddItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types);
508 void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types);
509 void updateOrAddGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types);
510 void updateOrRemoveGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types);
511
512 QQuickStateGroup *_states();
513 QQuickStateGroup *_stateGroup;
514
515 inline QQuickItem::TransformOrigin origin() const;
516
517 // Bit 0
518 quint32 flags:7;
519 quint32 widthValidFlag:1;
520 quint32 heightValidFlag:1;
521 quint32 componentComplete:1;
522 quint32 keepMouse:1;
523 quint32 keepTouch:1;
524 quint32 hoverEnabled:1;
525 quint32 smooth:1;
526 quint32 antialiasing:1;
527 quint32 focus:1;
528 // Bit 16
529 quint32 activeFocus:1;
530 quint32 notifiedFocus:1;
531 quint32 notifiedActiveFocus:1;
532 quint32 filtersChildMouseEvents:1;
533 quint32 explicitVisible:1;
534 quint32 effectiveVisible:1;
535 quint32 explicitEnable:1;
536 quint32 effectiveEnable:1;
537 quint32 polishScheduled:1;
538 quint32 inheritedLayoutMirror:1;
539 quint32 effectiveLayoutMirror:1;
540 quint32 isMirrorImplicit:1;
541 quint32 inheritMirrorFromParent:1;
542 quint32 inheritMirrorFromItem:1;
543 quint32 isAccessible:1;
544 quint32 culled:1;
545 // Bit 32
546 quint32 hasCursor:1;
547 quint32 subtreeCursorEnabled:1;
548 quint32 subtreeHoverEnabled:1;
549 quint32 activeFocusOnTab:1;
550 quint32 implicitAntialiasing:1;
551 quint32 antialiasingValid:1;
552 // isTabFence: When true, the item acts as a fence within the tab focus chain.
553 // This means that the item and its children will be skipped from the tab focus
554 // chain when navigating from its parent or any of its siblings. Similarly,
555 // when any of the item's descendants gets focus, the item constrains the tab
556 // focus chain and prevents tabbing outside.
557 quint32 isTabFence:1;
558 quint32 replayingPressEvent:1;
559 // Bit 40
560 quint32 touchEnabled:1;
561 quint32 hasCursorHandler:1;
562 // set true when this item does not expect events via a subscene delivery agent; false otherwise
563 quint32 maybeHasSubsceneDeliveryAgent:1;
564 // set true if this item or any child wants QQuickItemPrivate::transformChanged() to visit all children
565 // (e.g. when parent has ItemIsViewport and child has ItemObservesViewport)
566 quint32 subtreeTransformChangedEnabled:1;
567 quint32 inDestructor:1; // has entered ~QQuickItem
568 quint32 focusReason:4;
569 quint32 focusPolicy:4;
570 // Bit 53
571 // eventHandlingChildrenWithinBounds is true if all children recursively
572 // are known to be within their parents' bounds.
573 // eventHandlingChildrenWithinBoundsSet is true only when we've checked.
574 mutable quint32 eventHandlingChildrenWithinBounds:1;
575 mutable quint32 eventHandlingChildrenWithinBoundsSet:1;
576 // Bit 55
577 quint32 customOverlay:1;
578 // Bit 56
579
580 static bool customOverlayRequested;
581 void requestCustomOverlay();
582
583 enum DirtyType {
584 TransformOrigin = 0x00000001,
585 Transform = 0x00000002,
586 BasicTransform = 0x00000004,
587 Position = 0x00000008,
588 Size = 0x00000010,
589
590 ZValue = 0x00000020,
591 Content = 0x00000040,
592 Smooth = 0x00000080,
593 OpacityValue = 0x00000100,
594 ChildrenChanged = 0x00000200,
595 ChildrenStackingChanged = 0x00000400,
596 ParentChanged = 0x00000800,
597
598 Clip = 0x00001000,
599 Window = 0x00002000,
600
601 EffectReference = 0x00008000,
602 Visible = 0x00010000,
603 HideReference = 0x00020000,
604 Antialiasing = 0x00040000,
605 // When you add an attribute here, don't forget to update
606 // dirtyToString()
607
608 TransformUpdateMask = TransformOrigin | Transform | BasicTransform | Position |
609 Window,
610 ComplexTransformUpdateMask = Transform | Window,
611 ContentUpdateMask = Size | Content | Smooth | Window | Antialiasing,
612 ChildrenUpdateMask = ChildrenChanged | ChildrenStackingChanged | EffectReference | Window
613 };
614
615 quint32 dirtyAttributes;
616 QString dirtyToString() const;
617 void dirty(DirtyType);
618 void addToDirtyList();
619 void removeFromDirtyList();
620 QQuickItem *nextDirtyItem;
621 QQuickItem**prevDirtyItem;
622
623 void setCulled(bool);
624
625 QQuickWindow *window;
626 int windowRefCount;
627 inline QSGContext *sceneGraphContext() const;
628 inline QSGRenderContext *sceneGraphRenderContext() const;
629
630 QQuickItem *parentItem;
631
632 QList<QQuickItem *> childItems;
633 mutable QList<QQuickItem *> *sortedChildItems;
634 QList<QQuickItem *> paintOrderChildItems() const;
635 void addChild(QQuickItem *);
636 void removeChild(QQuickItem *);
637 void siblingOrderChanged();
638
639 inline void markSortedChildrenDirty(QQuickItem *child);
640
641 void refWindow(QQuickWindow *);
642 void derefWindow();
643
644 qreal effectiveDevicePixelRatio() const;
645
646 QPointer<QQuickItem> subFocusItem;
647 void updateSubFocusItem(QQuickItem *scope, bool focus);
648
649 bool setFocusIfNeeded(QEvent::Type);
650 Qt::FocusReason lastFocusChangeReason() const;
651 virtual bool setLastFocusChangeReason(Qt::FocusReason reason);
652
653 QTransform windowToItemTransform() const;
654 QTransform itemToWindowTransform() const;
655 void itemToParentTransform(QTransform *) const;
656
657 static bool focusNextPrev(QQuickItem *item, bool forward);
658 static QQuickItem *nextTabChildItem(const QQuickItem *item, int start);
659 static QQuickItem *prevTabChildItem(const QQuickItem *item, int start);
660 static QQuickItem *nextPrevItemInTabFocusChain(QQuickItem *item, bool forward, bool wrap = true);
661
662 static bool canAcceptTabFocus(QQuickItem *item);
663
664 void setX(qreal x) {q_func()->setX(x);}
665 void xChanged() { Q_EMIT q_func()->xChanged(); }
666 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, x, &QQuickItemPrivate::setX, &QQuickItemPrivate::xChanged);
667 void setY(qreal y) {q_func()->setY(y);}
668 void yChanged() { Q_EMIT q_func()->yChanged(); }
669 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, y, &QQuickItemPrivate::setY, &QQuickItemPrivate::yChanged);
670 void setWidth(qreal width) {q_func()->setWidth(width);}
671 void widthChanged() { Q_EMIT q_func()->widthChanged(); }
672 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, width, &QQuickItemPrivate::setWidth, &QQuickItemPrivate::widthChanged);
673 void setHeight(qreal height) {q_func()->setHeight(height);}
674 void heightChanged() { Q_EMIT q_func()->heightChanged(); }
675 Q_OBJECT_COMPAT_PROPERTY(QQuickItemPrivate, qreal, height, &QQuickItemPrivate::setHeight, &QQuickItemPrivate::heightChanged);
676 qreal implicitWidth;
677 qreal implicitHeight;
678
679 bool widthValid() const { return widthValidFlag || (width.hasBinding() && !QQmlPropertyBinding::isUndefined(width.binding()) ); }
680 bool heightValid() const { return heightValidFlag || (height.hasBinding() && !QQmlPropertyBinding::isUndefined(height.binding()) ); }
681
682 qreal baselineOffset;
683
684 QList<QQuickTransform *> transforms;
685
686 inline qreal z() const { return extra.isAllocated()?extra->z:0; }
687 inline qreal scale() const { return extra.isAllocated()?extra->scale:1; }
688 inline qreal rotation() const { return extra.isAllocated()?extra->rotation:0; }
689 inline qreal opacity() const { return extra.isAllocated()?extra->opacity:1; }
690
691 void setAccessible();
692
693 virtual qreal getImplicitWidth() const;
694 virtual qreal getImplicitHeight() const;
695 virtual void implicitWidthChanged();
696 virtual void implicitHeightChanged();
697
698#if QT_CONFIG(accessibility)
699 QAccessible::Role effectiveAccessibleRole() const;
700private:
701 virtual QAccessible::Role accessibleRole() const;
702public:
703#endif
704
705 void setImplicitAntialiasing(bool antialiasing);
706
707 void resolveLayoutMirror();
708 void setImplicitLayoutMirror(bool mirror, bool inherit);
709 void setLayoutMirror(bool mirror);
710 bool isMirrored() const {
711 return effectiveLayoutMirror;
712 }
713
714 void emitChildrenRectChanged(const QRectF &rect) {
715 Q_Q(QQuickItem);
716 Q_EMIT q->childrenRectChanged(rect);
717 }
718
719 QPointF computeTransformOrigin() const;
720 virtual bool transformChanged(QQuickItem *transformedItem);
721
722 QPointF adjustedPosForTransform(const QPointF &centroid,
723 const QPointF &startPos, const QVector2D &activeTranslatation,
724 qreal startScale, qreal activeScale,
725 qreal startRotation, qreal activeRotation);
726
727 QQuickDeliveryAgent *deliveryAgent();
728 QQuickDeliveryAgentPrivate *deliveryAgentPrivate();
729 QQuickDeliveryAgent *ensureSubsceneDeliveryAgent();
730
731 void deliverKeyEvent(QKeyEvent *);
732 bool filterKeyEvent(QKeyEvent *, bool post);
733#if QT_CONFIG(im)
734 void deliverInputMethodEvent(QInputMethodEvent *);
735#endif
736 void deliverShortcutOverrideEvent(QKeyEvent *);
737
738 void deliverPointerEvent(QEvent *);
739
740 bool anyPointerHandlerWants(const QPointerEvent *event, const QEventPoint &point) const;
741 virtual bool handlePointerEvent(QPointerEvent *, bool avoidGrabbers = false);
742#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
743 virtual bool handleContextMenuEvent(QContextMenuEvent *event);
744#endif
745
746 virtual void setVisible(bool visible);
747
748 bool isTransparentForPositioner() const;
749 void setTransparentForPositioner(bool trans);
750
751 bool calcEffectiveVisible() const;
752 bool setEffectiveVisibleRecur(bool);
753 bool calcEffectiveEnable() const;
754 void setEffectiveEnableRecur(QQuickItem *scope, bool);
755
756 qreal biggestPointerHandlerMargin() const;
757 QRectF eventHandlingBounds(qreal margin = 0) const;
758 bool parentFullyContains() const;
759 bool effectivelyClipsEventHandlingChildren() const;
760
761 inline QSGTransformNode *itemNode();
762 inline QSGNode *childContainerNode();
763
764 /*
765 QSGNode order is:
766 - itemNode
767 - (opacityNode)
768 - (clipNode)
769 - (rootNode) (shader effect source's root node)
770 */
771
772 QSGOpacityNode *opacityNode() const { return extra.isAllocated()?extra->opacityNode:nullptr; }
773 QQuickDefaultClipNode *clipNode() const { return extra.isAllocated()?extra->clipNode:nullptr; }
774 QSGRootNode *rootNode() const { return extra.isAllocated()?extra->rootNode:nullptr; }
775
776 QSGTransformNode *itemNodeInstance;
777 QSGNode *paintNode;
778
779 virtual QSGTransformNode *createTransformNode();
780
781 // A reference from an effect item means that this item is used by the effect, so
782 // it should insert a root node.
783 void refFromEffectItem(bool hide);
784 void recursiveRefFromEffectItem(int refs);
785 void derefFromEffectItem(bool unhide);
786
787 void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &);
788
789 void enableSubtreeChangeNotificationsForParentHierachy();
790
791 virtual void mirrorChange() {}
792
793 void setHasCursorInChild(bool hasCursor);
794 void setHasHoverInChild(bool hasHover);
795#if QT_CONFIG(cursor)
796 QCursor effectiveCursor(const QQuickPointerHandler *handler) const;
797 QQuickPointerHandler *effectiveCursorHandler() const;
798#endif
799
800 virtual void updatePolish() { }
801 virtual void dumpItemTree(int indent) const;
802
803 QLayoutPolicy sizePolicy() const;
804 void setSizePolicy(const QLayoutPolicy::Policy &horizontalPolicy, const QLayoutPolicy::Policy &verticalPolicy);
805 QLayoutPolicy szPolicy;
806
807#ifdef QT_BUILD_INTERNAL
808 inline static quint32 item_counter = 0;
809 inline static quint32 itemExtra_counter = 0;
810 inline static quint32 eventHandlingChildrenWithinBounds_counter = 0;
811 inline static quint64 itemToParentTransform_counter = 0;
812 inline static quint64 itemToWindowTransform_counter = 0;
813 inline static quint64 windowToItemTransform_counter = 0;
814 inline static quint64 effectiveClippingSkips_counter = 0;
815#endif
816};
817
818Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickItemPrivate::ExtraDataTags)
819
820/*
821 Key filters can be installed on a QQuickItem, but not removed. Currently they
822 are only used by attached objects (which are only destroyed on Item
823 destruction), so this isn't a problem. If in future this becomes any form
824 of public API, they will have to support removal too.
825*/
826class QQuickItemKeyFilter
827{
828public:
829 QQuickItemKeyFilter(QQuickItem * = nullptr);
830 virtual ~QQuickItemKeyFilter();
831
832 virtual void keyPressed(QKeyEvent *event, bool post);
833 virtual void keyReleased(QKeyEvent *event, bool post);
834#if QT_CONFIG(im)
835 virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
836 virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
837#endif
838 virtual void shortcutOverrideEvent(QKeyEvent *event);
839 virtual void componentComplete();
840
841 bool m_processPost;
842
843private:
844 QQuickItemKeyFilter *m_next;
845};
846
867
868class Q_QUICK_EXPORT QQuickKeyNavigationAttached : public QObject, public QQuickItemKeyFilter
869{
870 Q_OBJECT
871 Q_DECLARE_PRIVATE(QQuickKeyNavigationAttached)
872
873 Q_PROPERTY(QQuickItem *left READ left WRITE setLeft NOTIFY leftChanged FINAL)
874 Q_PROPERTY(QQuickItem *right READ right WRITE setRight NOTIFY rightChanged FINAL)
875 Q_PROPERTY(QQuickItem *up READ up WRITE setUp NOTIFY upChanged FINAL)
876 Q_PROPERTY(QQuickItem *down READ down WRITE setDown NOTIFY downChanged FINAL)
877 Q_PROPERTY(QQuickItem *tab READ tab WRITE setTab NOTIFY tabChanged FINAL)
878 Q_PROPERTY(QQuickItem *backtab READ backtab WRITE setBacktab NOTIFY backtabChanged FINAL)
879 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged FINAL)
880
881 QML_NAMED_ELEMENT(KeyNavigation)
882 QML_ADDED_IN_VERSION(2, 0)
883 QML_UNCREATABLE("KeyNavigation is only available via attached properties.")
884 QML_ATTACHED(QQuickKeyNavigationAttached)
885
886public:
887 QQuickKeyNavigationAttached(QObject * = nullptr);
888
889 QQuickItem *left() const;
890 void setLeft(QQuickItem *);
891 QQuickItem *right() const;
892 void setRight(QQuickItem *);
893 QQuickItem *up() const;
894 void setUp(QQuickItem *);
895 QQuickItem *down() const;
896 void setDown(QQuickItem *);
897 QQuickItem *tab() const;
898 void setTab(QQuickItem *);
899 QQuickItem *backtab() const;
900 void setBacktab(QQuickItem *);
901
902 enum Priority { BeforeItem, AfterItem };
903 Q_ENUM(Priority)
904 Priority priority() const;
905 void setPriority(Priority);
906
907 static QQuickKeyNavigationAttached *qmlAttachedProperties(QObject *);
908
909Q_SIGNALS:
910 void leftChanged();
911 void rightChanged();
912 void upChanged();
913 void downChanged();
914 void tabChanged();
915 void backtabChanged();
916 void priorityChanged();
917
918private:
919 void keyPressed(QKeyEvent *event, bool post) override;
920 void keyReleased(QKeyEvent *event, bool post) override;
921 void setFocusNavigation(QQuickItem *currentItem, const char *dir,
922 Qt::FocusReason reason = Qt::OtherFocusReason);
923};
924
926{
927 Q_OBJECT
928 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged FINAL)
930
933 QML_UNCREATABLE("LayoutMirroring is only available via attached properties.")
935
936public:
937 explicit QQuickLayoutMirroringAttached(QObject *parent = nullptr);
938
939 bool enabled() const;
940 void setEnabled(bool);
941 void resetEnabled();
942
943 bool childrenInherit() const;
944 void setChildrenInherit(bool);
945
950private:
951 friend class QQuickItemPrivate;
952 QQuickItemPrivate *itemPrivate;
953};
954
956{
957 Q_OBJECT
958 Q_PROPERTY(Qt::EnterKeyType type READ type WRITE setType NOTIFY typeChanged FINAL)
959
961 QML_UNCREATABLE("EnterKey is only available via attached properties")
964
965public:
966 explicit QQuickEnterKeyAttached(QObject *parent = nullptr);
967
968 Qt::EnterKeyType type() const;
969 void setType(Qt::EnterKeyType type);
970
974private:
975 friend class QQuickItemPrivate;
976 QQuickItemPrivate *itemPrivate;
977
978 Qt::EnterKeyType keyType;
979};
980
982{
983public:
985 : inPress(false), inRelease(false), inIM(false), enabled(true)
986 {}
987
988 //loop detection
989 bool inPress:1;
990 bool inRelease:1;
991 bool inIM:1;
992
993 bool enabled : 1;
994
995 QQuickItem *imeItem = nullptr;
997 QQuickItem *item = nullptr;
999};
1000
1001class Q_QUICK_EXPORT QQuickKeysAttached : public QObject, public QQuickItemKeyFilter
1002{
1003 Q_OBJECT
1004 Q_DECLARE_PRIVATE(QQuickKeysAttached)
1005
1006 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
1007 Q_PROPERTY(QQmlListProperty<QQuickItem> forwardTo READ forwardTo FINAL)
1008 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged FINAL)
1009
1010 QML_NAMED_ELEMENT(Keys)
1011 QML_ADDED_IN_VERSION(2, 0)
1012 QML_UNCREATABLE("Keys is only available via attached properties")
1013 QML_ATTACHED(QQuickKeysAttached)
1014
1015public:
1016 QQuickKeysAttached(QObject *parent=nullptr);
1017 ~QQuickKeysAttached() override;
1018
1019 bool enabled() const { Q_D(const QQuickKeysAttached); return d->enabled; }
1020 void setEnabled(bool enabled) {
1021 Q_D(QQuickKeysAttached);
1022 if (enabled != d->enabled) {
1023 d->enabled = enabled;
1024 Q_EMIT enabledChanged();
1025 }
1026 }
1027
1028 enum Priority { BeforeItem, AfterItem};
1029 Q_ENUM(Priority)
1030 Priority priority() const;
1031 void setPriority(Priority);
1032
1033 QQmlListProperty<QQuickItem> forwardTo() {
1034 Q_D(QQuickKeysAttached);
1035 return QQmlListProperty<QQuickItem>(this, &(d->targets));
1036 }
1037
1038 void componentComplete() override;
1039
1040 static QQuickKeysAttached *qmlAttachedProperties(QObject *);
1041
1042Q_SIGNALS:
1043 void enabledChanged();
1044 void priorityChanged();
1045 void pressed(QQuickKeyEvent *event);
1046 void released(QQuickKeyEvent *event);
1047 void shortcutOverride(QQuickKeyEvent *event);
1048 void digit0Pressed(QQuickKeyEvent *event);
1049 void digit1Pressed(QQuickKeyEvent *event);
1050 void digit2Pressed(QQuickKeyEvent *event);
1051 void digit3Pressed(QQuickKeyEvent *event);
1052 void digit4Pressed(QQuickKeyEvent *event);
1053 void digit5Pressed(QQuickKeyEvent *event);
1054 void digit6Pressed(QQuickKeyEvent *event);
1055 void digit7Pressed(QQuickKeyEvent *event);
1056 void digit8Pressed(QQuickKeyEvent *event);
1057 void digit9Pressed(QQuickKeyEvent *event);
1058
1059 void leftPressed(QQuickKeyEvent *event);
1060 void rightPressed(QQuickKeyEvent *event);
1061 void upPressed(QQuickKeyEvent *event);
1062 void downPressed(QQuickKeyEvent *event);
1063 void tabPressed(QQuickKeyEvent *event);
1064 void backtabPressed(QQuickKeyEvent *event);
1065
1066 void asteriskPressed(QQuickKeyEvent *event);
1067 void numberSignPressed(QQuickKeyEvent *event);
1068 void escapePressed(QQuickKeyEvent *event);
1069 void returnPressed(QQuickKeyEvent *event);
1070 void enterPressed(QQuickKeyEvent *event);
1071 void deletePressed(QQuickKeyEvent *event);
1072 void spacePressed(QQuickKeyEvent *event);
1073 void backPressed(QQuickKeyEvent *event);
1074 void cancelPressed(QQuickKeyEvent *event);
1075 void selectPressed(QQuickKeyEvent *event);
1076 void yesPressed(QQuickKeyEvent *event);
1077 void noPressed(QQuickKeyEvent *event);
1078 void context1Pressed(QQuickKeyEvent *event);
1079 void context2Pressed(QQuickKeyEvent *event);
1080 void context3Pressed(QQuickKeyEvent *event);
1081 void context4Pressed(QQuickKeyEvent *event);
1082 void callPressed(QQuickKeyEvent *event);
1083 void hangupPressed(QQuickKeyEvent *event);
1084 void flipPressed(QQuickKeyEvent *event);
1085 void menuPressed(QQuickKeyEvent *event);
1086 void volumeUpPressed(QQuickKeyEvent *event);
1087 void volumeDownPressed(QQuickKeyEvent *event);
1088
1089private:
1090 void keyPressed(QKeyEvent *event, bool post) override;
1091 void keyReleased(QKeyEvent *event, bool post) override;
1092#if QT_CONFIG(im)
1093 void inputMethodEvent(QInputMethodEvent *, bool post) override;
1094 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
1095#endif
1096 void shortcutOverrideEvent(QKeyEvent *event) override;
1097 static QByteArray keyToSignal(int key);
1098
1099 bool isConnected(const char *signalName) const;
1100};
1101
1102Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const
1103{
1104 return ((extra.tag().testFlag(LeftMouseButtonAccepted) ? Qt::LeftButton : Qt::MouseButton(0)) |
1105 (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons{}));
1106}
1107
1108QSGContext *QQuickItemPrivate::sceneGraphContext() const
1109{
1110 Q_ASSERT(window);
1111 return static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(window))->context->sceneGraphContext();
1112}
1113
1114QSGRenderContext *QQuickItemPrivate::sceneGraphRenderContext() const
1115{
1116 Q_ASSERT(window);
1117 return static_cast<QQuickWindowPrivate *>(QObjectPrivate::get(window))->context;
1118}
1119
1120void QQuickItemPrivate::markSortedChildrenDirty(QQuickItem *child)
1121{
1122 // If sortedChildItems == &childItems then all in childItems have z == 0
1123 // and we don't need to invalidate if the changed item also has z == 0.
1124 if (child->z() != 0. || sortedChildItems != &childItems) {
1125 if (sortedChildItems != &childItems)
1126 delete sortedChildItems;
1127 sortedChildItems = nullptr;
1128 }
1129}
1130
1131QQuickItem::TransformOrigin QQuickItemPrivate::origin() const
1132{
1133 return extra.isAllocated() ? QQuickItem::TransformOrigin(extra->origin)
1134 : QQuickItem::Center;
1135}
1136
1137QSGTransformNode *QQuickItemPrivate::itemNode()
1138{
1139 if (!itemNodeInstance) {
1140 itemNodeInstance = createTransformNode();
1141 itemNodeInstance->setFlag(QSGNode::OwnedByParent, false);
1142#ifdef QSG_RUNTIME_DESCRIPTION
1143 Q_Q(QQuickItem);
1144 qsgnode_set_description(itemNodeInstance, QString::fromLatin1("QQuickItem(%1:%2)").arg(QString::fromLatin1(q->metaObject()->className())).arg(q->objectName()));
1145#endif
1146 }
1147 return itemNodeInstance;
1148}
1149
1150QSGNode *QQuickItemPrivate::childContainerNode()
1151{
1152 if (rootNode())
1153 return rootNode();
1154 else if (clipNode())
1155 return clipNode();
1156 else if (opacityNode())
1157 return opacityNode();
1158 else
1159 return itemNode();
1160}
1161
1162Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickItemPrivate::ChangeTypes)
1163Q_DECLARE_TYPEINFO(QQuickItemPrivate::ChangeListener, Q_PRIMITIVE_TYPE);
1164
1165QT_END_NAMESPACE
1166
1167#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)