48 Q_PROPERTY(
bool active READ active WRITE setActive NOTIFY activeChanged)
49 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
50 Q_PROPERTY(QQmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceComponentChanged)
51 Q_PROPERTY(QObject *item READ item NOTIFY itemChanged)
52 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
53 Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
54 Q_PROPERTY(
bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
56 QML_NAMED_ELEMENT(Loader3D)
59 explicit QQuick3DLoader(QQuick3DNode *parent =
nullptr);
60 ~QQuick3DLoader() override;
63 void setActive(
bool newVal);
65 Q_INVOKABLE
void setSource(QQmlV4FunctionPtr);
68 void setSource(
const QUrl &);
70 QQmlComponent *sourceComponent()
const;
71 void setSourceComponent(QQmlComponent *);
72 void resetSourceComponent();
74 enum Status { Null, Ready, Loading, Error };
76 Status status()
const;
77 qreal progress()
const;
79 bool asynchronous()
const;
80 void setAsynchronous(
bool a);
82 QObject *item()
const;
88 void sourceComponentChanged();
90 void progressChanged();
92 void asynchronousChanged();
95 void componentComplete() override;
101 Q_DISABLE_COPY(QQuick3DLoader)
102 friend QQuick3DLoaderIncubator;
103 void setSource(
const QUrl &sourceUrl,
bool needsClear);
104 void loadFromSource();
105 void loadFromSourceComponent();
109 void incubatorStateChanged(QQmlIncubator::Status status);
110 void setInitialState(QObject *obj);
111 void disposeInitialPropertyValues();
112 static QUrl resolveSourceUrl(QQmlV4FunctionPtr args);
113 QV4::ReturnedValue extractInitialPropertyValues(QQmlV4FunctionPtr args,
bool *error);
115 void createComponent();
118 QQuick3DNode *m_item;
120 QQmlStrongJSQObjectReference<QQmlComponent> m_component;
121 QQmlContext *m_itemContext;
122 QQuick3DLoaderIncubator *m_incubator;
123 QV4::PersistentValue m_initialPropertyValues;
124 QV4::PersistentValue m_qmlCallingContext;
126 bool m_loadingFromSource : 1;
127 bool m_asynchronous : 1;