4#ifndef QQMLINCUBATOR_P_H
5#define QQMLINCUBATOR_P_H
9#include <private/qintrusivelist_p.h>
10#include <private/qqmlvme_p.h>
11#include <private/qrecursionwatcher_p.h>
12#include <private/qqmlengine_p.h>
13#include <private/qqmlguardedcontextdata_p.h>
15#include <QtCore/qpointer.h>
36 QQmlIncubatorPrivate(QQmlIncubator *q, QQmlIncubator::IncubationMode m);
37 ~QQmlIncubatorPrivate();
39 inline static QQmlIncubatorPrivate *get(QQmlIncubator *incubator) {
return incubator->d; }
41 int subComponentToCreate;
44 QQmlIncubator::Status calculateStatus()
const;
45 void changeStatus(QQmlIncubator::Status);
46 QQmlIncubator::Status status;
48 QQmlIncubator::IncubationMode mode;
50 enum Progress :
char { Execute, Completing, Completed };
53 QList<QQmlError> errors;
56 QPointer<QObject> result;
57 enum HadTopLevelRequired :
bool {No = 0, Yes = 1};
59
60
61
62
63
64 QTaggedPointer<RequiredProperties, HadTopLevelRequired> requiredPropertiesFromComponent;
65 QQmlGuardedContextData rootContext;
66 QQmlEnginePrivate *enginePriv;
67 QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
68 QScopedPointer<QQmlObjectCreator> creator;
69 QQmlVMEGuard vmeGuard;
71 QExplicitlySharedDataPointer<QQmlIncubatorPrivate> waitingOnMe;
72 typedef QQmlEnginePrivate::Incubator QIPBase;
73 QIntrusiveListNode nextWaitingFor;
74 QIntrusiveList<QQmlIncubatorPrivate, &QQmlIncubatorPrivate::nextWaitingFor> waitingFor;
76 QRecursionNode recursion;
77 QVariantMap initialProperties;
81 void forceCompletion(QQmlInstantiationInterrupt &i);
82 void incubate(QQmlInstantiationInterrupt &i);
83 void incubateCppBasedComponent(QQmlComponent *component, QQmlContext *context);
84 RequiredProperties *requiredProperties();
85 bool hadTopLevelRequiredProperties()
const;
QJSEngine * engine() const
Returns the QJSEngine this QJSManagedValue belongs to.
bool isError() const
Returns true if this value represents a JavaScript Error object, or false otherwise.
bool isNull() const
Returns true if this QJSManagedValue holds the JavaScript null value, or false otherwise.
void setInitialState(QObject *o) override
Called after the object is first created, but before complex property bindings are evaluated and,...
void statusChanged(Status s) override
Called when the status of the incubator changes.
QQmlComponentIncubator(QV4::Heap::QmlIncubatorObject *inc, IncubationMode mode)
QV4::PersistentValue incubatorObject
The QQmlComponent class encapsulates a QML component definition.
The QQmlError class encapsulates a QML error.
QQmlIncubationController instances drive the progress of QQmlIncubators.
void incubateFor(int msecs)
Incubate objects for msecs, or until there are no more objects to incubate.
int incubatingObjectCount() const
Return the number of objects currently incubating.
virtual ~QQmlIncubationController()
void incubateWhile(std::atomic< bool > *flag, int msecs=0)
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 setInitialProperties(const QVariantMap &initialProperties)
Stores a mapping from property names to initial values, contained in initialProperties,...
friend class QQmlEnginePrivate
friend class QQmlIncubatorPrivate
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.
virtual void setInitialState(QObject *)
Called after the object is first created, but before complex property bindings are evaluated and,...
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.
IncubationMode incubationMode() const
Return the incubation mode passed to the QQmlIncubator constructor.
bool isReady() const
Returns true if the incubator's status() is Ready.
QQmlInstantiationInterrupt(std::atomic< bool > *runWhile, QDeadlineTimer deadline=QDeadlineTimer::Forever)
bool shouldInterrupt() const
QQmlInstantiationInterrupt()
QQmlInstantiationInterrupt(QDeadlineTimer deadline)
void guard(QQmlObjectCreator *)
void clear()
Clears the entire result set and releases any associated resources.
Combined button and popup list for selecting options.
DECLARE_HEAP_OBJECT(QmlContext, ExecutionContext)
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
static void removePendingQPropertyBinding(QV4::Value *object, const QString &propertyName, const QQmlObjectCreator *creator)
static void QQmlComponent_setQmlParent(QObject *me, QObject *parent)
DEFINE_OBJECT_VTABLE(QV4::QmlIncubatorObject)
V4_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension)
static QQmlParserStatus * parserStatusCast(const QQmlType &type, QObject *rv)
QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error)
static ReturnedValue method_set_statusChanged(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_status(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_object(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void statusChanged(QQmlIncubator::Status)
void setInitialState(QObject *, RequiredProperties *requiredProperties)
static ReturnedValue method_forceCompletion(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)