8#include <QtQml/qqmlinfo.h>
10#include <private/qqmlengine_p.h>
11#include <private/qqmlglobal_p.h>
13#include <private/qqmlcomponent_p.h>
14#include <private/qqmlincubator_p.h>
20 m_loader->incubatorStateChanged(
status);
25 m_loader->setInitialState(
o);
57 , m_loadingFromSource(
false)
58 , m_asynchronous(
false)
65 m_itemContext =
nullptr;
67 m_incubator =
nullptr;
68 disposeInitialPropertyValues();
95 if (m_active == newVal)
100 if (m_loadingFromSource) {
103 loadFromSourceComponent();
108 m_incubator->
clear();
109 delete m_itemContext;
110 m_itemContext =
nullptr;
138 bool ipvError =
false;
146 QUrl sourceUrl = resolveSourceUrl(
args);
148 disposeInitialPropertyValues();
149 m_initialPropertyValues.
set(
args->v4engine(), ipv);
232 if (comp == m_component)
238 m_loadingFromSource =
false;
241 loadFromSourceComponent();
297 switch (m_component->
status()) {
310 switch (m_incubator->
status()) {
395 return m_asynchronous;
400 if (m_asynchronous ==
a)
406 if (m_loadingFromSource && m_component && m_component->
isLoading()) {
408 QUrl currentSource = m_source;
410 m_source = currentSource;
412 }
else if (m_incubator && m_incubator->
isLoading()) {
434 if (m_loadingFromSource)
440void QQuick3DLoader::sourceLoaded()
445 if (m_loadingFromSource)
452 disposeInitialPropertyValues();
457 if (!creationContext) creationContext =
qmlContext(
this);
464 m_component->
create(*m_incubator, m_itemContext);
472 if (m_source == sourceUrl)
478 m_source = sourceUrl;
479 m_loadingFromSource =
true;
487void QQuick3DLoader::loadFromSource()
504void QQuick3DLoader::loadFromSourceComponent()
518void QQuick3DLoader::clear()
520 disposeInitialPropertyValues();
523 m_incubator->
clear();
525 delete m_itemContext;
526 m_itemContext =
nullptr;
534 if (m_loadingFromSource && m_component) {
537 this,
SLOT(sourceLoaded()));
542 }
else if (m_component) {
560void QQuick3DLoader::load()
570 this,
SLOT(sourceLoaded()));
575 if (m_loadingFromSource)
589 m_object = m_incubator->
object();
590 m_item = qmlobject_cast<QQuick3DNode*>(m_object);
592 m_incubator->
clear();
596 delete m_itemContext;
597 m_itemContext =
nullptr;
598 delete m_incubator->
object();
602 if (m_loadingFromSource)
610 disposeInitialPropertyValues();
613void QQuick3DLoader::setInitialState(
QObject *
obj)
617 item->setParentItem(
this);
622 m_itemContext =
nullptr;
638void QQuick3DLoader::disposeInitialPropertyValues()
651 auto context = scope.engine->callingQmlContext();
664 qmlWarning(
this) << QQuick3DLoader::tr(
"setSource: value is not an object");
671 return valuemap->asReturnedValue();
674void QQuick3DLoader::createComponent()
681 context->resolvedUrl(m_source),
689#include "moc_qquick3dloader_p.cpp"
bool isEmpty() const noexcept
qsizetype length() const noexcept
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void deleteLater()
\threadsafe
static QQmlComponentPrivate * get(QQmlComponent *c)
The QQmlComponent class encapsulates a QML component definition.
bool isLoading() const
Returns true if status() == QQmlComponent::Loading.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
Status status
\qmlproperty enumeration Component::status
QList< QQmlError > errors() const
Returns the list of errors that occurred during the last compile or create operation.
CompilationMode
Specifies whether the QQmlComponent should load the component immediately, or asynchonously.
qreal progress
\qmlproperty real Component::progress The progress of loading the component, from 0....
virtual QObject * create(QQmlContext *context=nullptr)
Create an object instance from this component, within the specified context.
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
void clearContextRecursively()
The QQmlContext class defines a context within a QML engine.
void setContextObject(QObject *)
Set the context object.
void warning(const QQmlError &)
static QQmlIncubatorPrivate * get(QQmlIncubator *incubator)
The QQmlIncubator class allows QML objects to be created asynchronously.
QList< QQmlError > errors() const
Return the list of errors encountered while incubating the object.
void clear()
Clears the incubator.
QObject * object() const
Return the incubated object if the status is Ready, otherwise 0.
bool isLoading() const
Returns true if the incubator's status() is Loading.
void forceCompletion()
Force any in-progress incubation to finish synchronously.
Status status() const
Return the current status of the incubator.
Status
Specifies the status of the QQmlIncubator.
friend class QQmlComponent
void setObject(T *obj, QObject *parent)
void statusChanged(Status) override
Called when the status of the incubator changes.
void setInitialState(QObject *) override
Called after the object is first created, but before property bindings are evaluated and,...
~QQuick3DLoader() override
QQmlComponent * sourceComponent
void resetSourceComponent()
void setSourceComponent(QQmlComponent *)
void asynchronousChanged()
void setActive(bool newVal)
Q_INVOKABLE void setSource(QQmlV4Function *)
void setAsynchronous(bool a)
QQuick3DLoader(QQuick3DNode *parent=nullptr)
\qmltype Loader3D \inqmlmodule QtQuick3D \inherits Node
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void sourceComponentChanged()
void setVisible(bool visible)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
void setParentItem(QQuick3DObject *parentItem)
bool isComponentComplete() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
ReturnedValue value() const
void set(ExecutionEngine *engine, const Value &value)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
QQmlEngine * qmlEngine(const QObject *obj)
QQmlContext * qmlContext(const QObject *obj)
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QUrl url("example.com")
[constructor-url-reference]
static constexpr ReturnedValue undefined()
static Heap::ExecutionContext * qmlContext(Heap::ExecutionContext *ctx)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent