46 Q_PROPERTY(
bool active READ active WRITE setActive NOTIFY activeChanged)
47 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
48 Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged)
49 Q_PROPERTY(QObject *item READ item NOTIFY itemChanged)
50 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
51 Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
52 Q_PROPERTY(
bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
54 QML_NAMED_ELEMENT(Loader3D)
57 explicit QQuick3DLoader(QQuick3DNode *parent =
nullptr);
58 ~QQuick3DLoader() override;
61 void setActive(
bool newVal);
63 Q_INVOKABLE
void setSource(QQmlV4FunctionPtr);
66 void setSource(
const QUrl &);
68 QQmlComponent *sourceComponent()
const;
69 void setSourceComponent(QQmlComponent *);
70 void resetSourceComponent();
72 enum Status { Null, Ready, Loading, Error };
74 Status status()
const;
75 qreal progress()
const;
77 bool asynchronous()
const;
78 void setAsynchronous(
bool a);
80 QObject *item()
const;
86 void sourceComponentChanged();
88 void progressChanged();
90 void asynchronousChanged();
93 void componentComplete() override;
99 Q_DISABLE_COPY(QQuick3DLoader)
100 friend QQuick3DLoaderIncubator;
101 void setSource(
const QUrl &sourceUrl,
bool needsClear);
102 void loadFromSource();
103 void loadFromSourceComponent();
107 void incubatorStateChanged(QQmlIncubator::Status status);
108 void setInitialState(QObject *obj);
109 void disposeInitialPropertyValues();
110 static QUrl resolveSourceUrl(QQmlV4FunctionPtr args);
111 QV4::ReturnedValue extractInitialPropertyValues(QQmlV4FunctionPtr args,
bool *error);
113 void createComponent();
116 QQuick3DNode *m_item;
118 QQmlStrongJSQObjectReference<QQmlComponent> m_component;
119 QQmlContext *m_itemContext;
120 QQuick3DLoaderIncubator *m_incubator;
121 QV4::PersistentValue m_initialPropertyValues;
122 QV4::PersistentValue m_qmlCallingContext;
124 bool m_loadingFromSource : 1;
125 bool m_asynchronous : 1;