7#include <qqmlregistration.h>
9#include "qml_material/export.hpp"
16class QML_MATERIAL_API AttachedPropertyNode :
public QObject {
20 Q_PROPERTY(QObject* inheritFrom READ inheritFrom WRITE setInheritFrom RESET resetInheritFrom
21 NOTIFY inheritFromChanged FINAL)
24 AttachedPropertyNode(QObject* target,
const QMetaObject* attachedType);
25 ~AttachedPropertyNode()
override;
27 QObject* target()
const;
29 QObject* inheritFrom()
const;
30 void setInheritFrom(QObject* source);
31 void resetInheritFrom();
34 void setInheritanceParent(QQuickItem*);
36 AttachedPropertyNode* attachedParent()
const;
37 QList<AttachedPropertyNode*> attachedChildren()
const;
39 Q_SIGNAL
void inheritFromChanged();
42 void initializeAttachedProperty();
43 void propagateAttachedValues();
45 virtual void updateInheritedValues() = 0;
48 void refreshPropagation();
51 AttachedPropertyNode* findParent();
52 bool acceptsParent(AttachedPropertyNode*)
const;
53 void setAttachedParent(AttachedPropertyNode*);
54 void adoptAttachedChildren();
56 void disconnectTarget();
58 QPointer<QObject> m_target;
59 QPointer<QObject> m_inherit_from;
60 QPointer<QQuickItem> m_inheritance_parent;
61 const QMetaObject* m_attached_type {
nullptr };
62 QPointer<AttachedPropertyNode> m_attached_parent;
63 QList<QPointer<AttachedPropertyNode>> m_attached_children;
64 QMetaObject::Connection m_parent_connection;
65 QMetaObject::Connection m_window_connection;
66 QMetaObject::Connection m_inherit_from_destroyed;
67 quint64 m_revision { 0 };
68 quint64 m_source_revision { 0 };
69 bool m_initialized {
false };
70 bool m_destroying {
false };
71 bool m_cycle_warning_issued {
false };
72 bool m_cross_engine_warning_issued {
false };