9#include <private/qqmlcomponent_p.h>
29 parentIncubator = incubator;
32 cctxt = cctxt->parent();
35 if (parentIncubator && parentIncubator->isAsynchronous) {
37 p->waitingOnMe = parentIncubator;
38 parentIncubator->waitingFor.insert(
p.data());
59 p->vmeGuard.guard(
p->creator.data());
76 if (
d->incubationController)
77 d->incubationController->d =
nullptr;
78 d->incubationController = controller;
79 if (controller) controller->d =
d;
90 return d->incubationController;
251 enum { EstimatedSizeInV4Frames = 2 };
258 error.setDescription(QQmlComponent::tr(
"Maximum call stack size exceeded."));
268 error.setDescription(QQmlComponent::tr(
"Object or context destroyed during incubation"));
318 for (
const auto& unsetRequiredProperty: *unsetRequiredProperties)
337 if (
i.shouldInterrupt())
351 }
while (!
i.shouldInterrupt());
363 isWaiting->incubate(
i);
388 Q_ASSERT(compPriv->loadedType.isCreatable());
391 if (
auto props = compPriv->state.requiredProperties()) {
395 q->setInitialState(
object.
get());
402 compPriv->completeCreate();
403 result =
object.release();
static constexpr ForeverConstant Forever
T * data() const noexcept
Returns a pointer to the shared data object.
bool empty() const noexcept
This function is provided for STL compatibility.
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
void remove()
If in a list, remove this node otherwise do nothing.
bool isInList() const
Returns true if this node is in a list, false otherwise.
N * first() const
Returns the first entry in this list, or null if the list is empty.
bool isEmpty() const noexcept
void push_back(parameter_type t)
const_iterator cend() const
const_iterator cbegin() const
void deleteLater()
\threadsafe
static QQmlError unsetRequiredPropertyToQQmlError(const RequiredPropertyInfo &unsetRequiredProperty)
static QQmlComponentPrivate * get(QQmlComponent *c)
static QQmlProperty removePropertyFromRequired(QObject *createdComponent, const QString &name, RequiredProperties *requiredProperties, QQmlEngine *engine, bool *wasInRequiredProperties=nullptr)
The QQmlComponent class encapsulates a QML component definition.
QQmlIncubatorPrivate * incubator() const
void setIncubator(QQmlIncubatorPrivate *incubator)
The QQmlContext class defines a context within a QML engine.
quint32 explicitIndestructibleSet
static QQmlData * get(QObjectPrivate *priv, bool create)
quint32 rootObjectInCreation
Q_REQUIRED_RESULT QQmlError removeError()
void warning(const QQmlError &)
QIntrusiveList< Incubator, &Incubator::next > incubatorList
void incubate(QQmlIncubator &, const QQmlRefPointer< QQmlContextData > &)
static QQmlEnginePrivate * get(QQmlEngine *e)
void referenceScarceResources()
QQmlDelayedError * erroredBindings
unsigned int incubatorCount
void dereferenceScarceResources()
QQmlIncubationController * incubationController
The QQmlEngine class provides an environment for instantiating QML components.
QQmlIncubationController * incubationController() const
Returns the currently set incubation controller, or 0 if no controller has been set.
void setIncubationController(QQmlIncubationController *)
Sets the engine's incubation controller.
The QQmlError class encapsulates a QML error.
void setContextData(QQmlRefPointer< QQmlContextData > contextData)
QQmlIncubationController instances drive the progress of QQmlIncubators.
QQmlEngine * engine() const
Return the QQmlEngine this incubation controller is set on, or 0 if it has not been set on any engine...
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()
virtual void incubatingObjectCountChanged(int)
Called when the number of incubating objects changes.
void incubateWhile(std::atomic< bool > *flag, int msecs=0)
QQmlIncubationController()
Create a new incubation controller.
QQmlIncubator::Status calculateStatus() const
bool hadTopLevelRequiredProperties() const
RequiredProperties * requiredProperties()
Return a pointer to a list of properties which are required but haven't been set yet.
void changeStatus(QQmlIncubator::Status)
void forceCompletion(QQmlInstantiationInterrupt &i)
QIntrusiveListNode nextWaitingFor
static QQmlIncubatorPrivate * get(QQmlIncubator *incubator)
QQmlGuardedContextData rootContext
QExplicitlySharedDataPointer< QQmlIncubatorPrivate > waitingOnMe
void incubateCppBasedComponent(QQmlComponent *component, QQmlContext *context)
QQmlIncubatorPrivate(QQmlIncubator *q, QQmlIncubator::IncubationMode m)
void incubate(QQmlInstantiationInterrupt &i)
QPointer< QObject > result
QScopedPointer< QQmlObjectCreator > creator
QQmlRefPointer< QV4::ExecutableCompilationUnit > compilationUnit
QQmlEnginePrivate * enginePriv
QQmlIncubator::IncubationMode mode
QList< QQmlError > errors
QTaggedPointer< RequiredProperties, HadTopLevelRequired > requiredPropertiesFromComponent
QVariantMap initialProperties
QIntrusiveList< QQmlIncubatorPrivate, &QQmlIncubatorPrivate::nextWaitingFor > waitingFor
QQmlIncubator::Status status
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.
void setInitialProperties(const QVariantMap &initialProperties)
Stores a mapping from property names to initial values, contained in initialProperties,...
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 statusChanged(Status)
Called when the status of the incubator changes.
bool isError() const
Returns true if the incubator's status() is Error.
IncubationMode
Specifies the mode the incubator operates in.
virtual void setInitialState(QObject *)
Called after the object is first created, but before property bindings are evaluated and,...
bool isNull() const
Returns true if the incubator's status() is Null.
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.
QQmlIncubator(IncubationMode=Asynchronous)
Create a new incubator with the specified mode.
bool isReady() const
Returns true if the incubator's status() is Ready.
bool finalize(QQmlInstantiationInterrupt &interrupt)
bool componentHadTopLevelRequiredProperties() const
QObject * create(int subComponentIndex=-1, QObject *parent=nullptr, QQmlInstantiationInterrupt *interrupt=nullptr, int flags=NormalObject)
RequiredProperties * requiredProperties()
QList< QQmlError > errors
QQmlRefPointer< QQmlContextData > rootContext() const
The QQmlProperty class abstracts accessing properties on objects created from QML.
bool isValid() const
Returns true if the QQmlProperty refers to a valid property, otherwise false.
bool write(const QVariant &) const
Sets the property value to value.
void guard(QQmlObjectCreator *)
T * data() const noexcept
Returns the value of the pointer referenced by this object.
bool isNull() const noexcept
Returns true if this object refers to \nullptr.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
T * data() const noexcept
QSet< QString >::iterator it
DBusConnection const char DBusError * error
GLenum GLuint GLsizei const GLenum * props
GLdouble GLdouble GLdouble GLdouble q
static qreal component(const QPointF &point, unsigned int i)
QLatin1StringView QLatin1String
QFutureWatcher< int > watcher
QDeadlineTimer deadline(30s)