Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQDMIncubationTask Class Reference

#include <qqmldelegatemodel_p_p.h>

+ Inheritance diagram for QQDMIncubationTask:
+ Collaboration diagram for QQDMIncubationTask:

Public Member Functions

 QQDMIncubationTask (QQmlDelegateModelPrivate *l, IncubationMode mode)
 
void initializeRequiredProperties (QQmlDelegateModelItem *modelItemToIncubate, QObject *object)
 
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 complex property bindings are evaluated and, if applicable, QQmlParserStatus::componentComplete() is called.
 
- Public Member Functions inherited from QQmlIncubator
 QQmlIncubator (IncubationMode=Asynchronous)
 Create a new incubator with the specified mode.
 
virtual ~QQmlIncubator ()
 
void clear ()
 Clears the incubator.
 
void forceCompletion ()
 Force any in-progress incubation to finish synchronously.
 
bool isNull () const
 Returns true if the incubator's status() is Null.
 
bool isReady () const
 Returns true if the incubator's status() is Ready.
 
bool isError () const
 Returns true if the incubator's status() is Error.
 
bool isLoading () const
 Returns true if the incubator's status() is Loading.
 
QList< QQmlErrorerrors () const
 Return the list of errors encountered while incubating the object.
 
IncubationMode incubationMode () const
 Return the incubation mode passed to the QQmlIncubator constructor.
 
Status status () const
 Return the current status of the incubator.
 
QObjectobject () const
 Return the incubated object if the status is Ready, otherwise 0.
 
void setInitialProperties (const QVariantMap &initialProperties)
 Stores a mapping from property names to initial values, contained in initialProperties, with which the incubated component will be initialized.
 

Public Attributes

QQmlDelegateModelItemincubating = nullptr
 
QQmlDelegateModelPrivatevdm = nullptr
 
QQmlRefPointer< QQmlContextDataproxyContext
 
QPointer< QObjectproxiedObject = nullptr
 
int index [QQmlListCompositor::MaximumGroupCount]
 

Additional Inherited Members

- Public Types inherited from QQmlIncubator
enum  IncubationMode { Asynchronous , AsynchronousIfNested , Synchronous }
 Specifies the mode the incubator operates in. More...
 
enum  Status { Null , Ready , Loading , Error }
 Specifies the status of the QQmlIncubator. More...
 

Detailed Description

Definition at line 181 of file qqmldelegatemodel_p_p.h.

Constructor & Destructor Documentation

◆ QQDMIncubationTask()

QQDMIncubationTask::QQDMIncubationTask ( QQmlDelegateModelPrivate * l,
IncubationMode mode )
inline

Definition at line 184 of file qqmldelegatemodel_p_p.h.

Member Function Documentation

◆ initializeRequiredProperties()

void QQDMIncubationTask::initializeRequiredProperties ( QQmlDelegateModelItem * modelItemToIncubate,
QObject * object )

Definition at line 890 of file qqmldelegatemodel.cpp.

References QQmlDelegateModelItem::contextData, d, QQmlDelegateModelItem::delegate, engine, QString::fromUtf8(), QQmlData::get(), QQmlComponentPrivate::get(), QQmlEnginePrivate::get(), QQmlIncubatorPrivate::get(), QJSEngine::handle(), i, incubating, QQmlAnyBinding::installOn(), mo, proxiedObject, proxyContext, Q_ASSERT, qMakePair(), qmlContext(), QQmlComponentPrivate::removePropertyFromRequired(), and QQmlContextData::setContextObject().

Referenced by QQmlTableInstanceModelIncubationTask::setInitialState(), and QQmlDelegateModelPrivate::setInitialState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInitialState()

void QQDMIncubationTask::setInitialState ( QObject * object)
overridevirtual

Called after the object is first created, but before complex property bindings are evaluated and, if applicable, QQmlParserStatus::componentComplete() is called.

This is equivalent to the point between QQmlComponent::beginCreate() and QQmlComponent::completeCreate(), and can be used to assign initial values to the object's properties.

The default implementation does nothing.

Note
Simple bindings such as numeric literals are evaluated before setInitialState() is called. The categorization of bindings into simple and complex ones is intentionally unspecified and may change between versions of Qt and depending on whether and how you are using \l{qmlcachegen}. You should not rely on any particular binding to be evaluated either before or after setInitialState() is called. For example, a constant expression like {MyType.EnumValue} may be recognized as such at compile time or deferred to be executed as binding. The same holds for constant expressions like {-(5)} or {"a" + " constant string"}.

Reimplemented from QQmlIncubator.

Reimplemented in QQmlTableInstanceModelIncubationTask.

Definition at line 1133 of file qqmldelegatemodel.cpp.

References o, QQmlDelegateModelPrivate::setInitialState(), and vdm.

+ Here is the call graph for this function:

◆ statusChanged()

void QQDMIncubationTask::statusChanged ( Status status)
overridevirtual

Called when the status of the incubator changes.

status is the new status.

The default implementation does nothing.

Reimplemented from QQmlIncubator.

Reimplemented in QQmlTableInstanceModelIncubationTask.

Definition at line 984 of file qqmldelegatemodel.cpp.

References QQmlDelegateModelItem::contextData, QObject::deleteLater(), incubating, QQmlDelegateModelPrivate::incubatorStatusChanged(), isDoneIncubating(), QQmlDelegateModelItem::object, Q_ASSERT, QQmlRefPointer< T >::reset(), QQmlDelegateModelItem::scriptRef, QQmlIncubator::status(), and vdm.

+ Here is the call graph for this function:

Member Data Documentation

◆ incubating

◆ index

◆ proxiedObject

QPointer<QObject> QQDMIncubationTask::proxiedObject = nullptr

Definition at line 196 of file qqmldelegatemodel_p_p.h.

Referenced by initializeRequiredProperties().

◆ proxyContext

QQmlRefPointer<QQmlContextData> QQDMIncubationTask::proxyContext

Definition at line 195 of file qqmldelegatemodel_p_p.h.

Referenced by initializeRequiredProperties().

◆ vdm

QQmlDelegateModelPrivate* QQDMIncubationTask::vdm = nullptr

Definition at line 194 of file qqmldelegatemodel_p_p.h.

Referenced by setInitialState(), and statusChanged().


The documentation for this class was generated from the following files: