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
QQmlContextData Class Reference

#include <qqmlcontextdata_p.h>

+ Collaboration diagram for QQmlContextData:

Public Types

enum  QmlObjectKind { OrdinaryObject , DocumentRoot }
 

Public Member Functions

void addref () const
 
void release () const
 
int count () const
 
int refCount () const
 
QQmlRefPointer< QV4::ExecutableCompilationUnittypeCompilationUnit () const
 
void initFromTypeCompilationUnit (const QQmlRefPointer< QV4::ExecutableCompilationUnit > &unit, int subComponentIndex)
 
void emitDestruction ()
 
void clearContext ()
 
void clearContextRecursively ()
 
void invalidate ()
 
bool isValid () const
 
bool isInternal () const
 
void setInternal (bool isInternal)
 
bool isJSContext () const
 
void setJSContext (bool isJSContext)
 
bool isPragmaLibraryContext () const
 
void setPragmaLibraryContext (bool library)
 
QQmlRefPointer< QQmlContextDataparent () const
 
void clearParent ()
 
void refreshExpressions ()
 
void addOwnedObject (QQmlData *ownedObject)
 
QQmlDataownedObjects () const
 
void setOwnedObjects (QQmlData *ownedObjects)
 
void installContext (QQmlData *ddata, QmlObjectKind kind)
 
QUrl resolvedUrl (const QUrl &) const
 
QQmlContextasQQmlContext ()
 
QQmlContextPrivateasQQmlContextPrivate ()
 
QObjectcontextObject () const
 
void setContextObject (QObject *contextObject)
 
template<typename HandleSelf , typename HandleLinked >
void deepClearContextObject (QObject *contextObject, HandleSelf &&handleSelf, HandleLinked &&handleLinked)
 
void deepClearContextObject (QObject *contextObject)
 
QQmlEngineengine () const
 
void setEngine (QQmlEngine *engine)
 
QQmlContextpublicContext () const
 
void clearPublicContext ()
 
int propertyIndex (const QString &name) const
 
int propertyIndex (QV4::String *name) const
 
QString propertyName (int index) const
 
void addPropertyNameAndIndex (const QString &name, int index)
 
void setExpressions (QQmlJavaScriptExpression *expressions)
 
QQmlJavaScriptExpressiontakeExpressions ()
 
void setChildContexts (const QQmlRefPointer< QQmlContextData > &childContexts)
 
QQmlRefPointer< QQmlContextDatachildContexts () const
 
QQmlRefPointer< QQmlContextDatatakeChildContexts ()
 
QQmlRefPointer< QQmlContextDatanextChild () const
 
int numIdValues () const
 
void setIdValue (int index, QObject *idValue)
 
bool isIdValueSet (int index) const
 
QQmlNotifieridValueBindings (int index) const
 
QObjectidValue (int index) const
 
QString findObjectId (const QObject *obj) const
 
QUrl url () const
 
QString urlString () const
 
void setBaseUrlString (const QString &baseUrlString)
 
QString baseUrlString () const
 
void setBaseUrl (const QUrl &baseUrl)
 
QUrl baseUrl () const
 
QQmlRefPointer< QQmlTypeNameCacheimports () const
 
void setImports (const QQmlRefPointer< QQmlTypeNameCache > &imports)
 
QQmlIncubatorPrivateincubator () const
 
void setIncubator (QQmlIncubatorPrivate *incubator)
 
QObjectextraObject () const
 
void setExtraObject (QObject *extraObject)
 
bool isRootObjectInCreation () const
 
void setRootObjectInCreation (bool rootInCreation)
 
QV4::PersistentValue importedScripts () const
 
void setImportedScripts (const QV4::PersistentValue &scripts)
 
QQmlRefPointer< QQmlContextDatalinkedContext () const
 
void setLinkedContext (const QQmlRefPointer< QQmlContextData > &context)
 
bool hasUnresolvedNames () const
 
void setUnresolvedNames (bool hasUnresolvedNames)
 
QQmlComponentAttachedcomponentAttacheds () const
 
void addComponentAttached (QQmlComponentAttached *attached)
 
void addExpression (QQmlJavaScriptExpression *expression)
 
bool valueTypesAreAddressable () const
 

Static Public Member Functions

static QQmlRefPointer< QQmlContextDatacreateRefCounted (const QQmlRefPointer< QQmlContextData > &parent)
 
static QQmlRefPointer< QQmlContextDatacreateChild (const QQmlRefPointer< QQmlContextData > &parent)
 
static QQmlRefPointer< QQmlContextDataget (QQmlContext *context)
 

Friends

class QQmlGuardedContextData
 
class QQmlContextPrivate
 

Detailed Description

Definition at line 33 of file qqmlcontextdata_p.h.

Member Enumeration Documentation

◆ QmlObjectKind

Enumerator
OrdinaryObject 
DocumentRoot 

Definition at line 106 of file qqmlcontextdata_p.h.

Member Function Documentation

◆ addComponentAttached()

void QQmlContextData::addComponentAttached ( QQmlComponentAttached * attached)

Definition at line 313 of file qqmlcontextdata.cpp.

References QQmlComponentAttached::insertIntoList().

+ Here is the call graph for this function:

◆ addExpression()

void QQmlContextData::addExpression ( QQmlJavaScriptExpression * expression)

Definition at line 318 of file qqmlcontextdata.cpp.

References QQmlJavaScriptExpression::insertIntoList().

Referenced by QQmlJavaScriptExpression::setContext().

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

◆ addOwnedObject()

void QQmlContextData::addOwnedObject ( QQmlData * ownedObject)

Definition at line 244 of file qqmlcontextdata.cpp.

References QQmlData::nextContextObject, and QQmlData::prevContextObject.

Referenced by installContext().

+ Here is the caller graph for this function:

◆ addPropertyNameAndIndex()

void QQmlContextData::addPropertyNameAndIndex ( const QString & name,
int index )
inline

Definition at line 187 of file qqmlcontextdata_p.h.

References Q_ASSERT.

◆ addref()

void QQmlContextData::addref ( ) const
inline

Definition at line 51 of file qqmlcontextdata_p.h.

◆ asQQmlContext()

QQmlContext * QQmlContextData::asQQmlContext ( )
inline

Definition at line 116 of file qqmlcontextdata_p.h.

◆ asQQmlContextPrivate()

QQmlContextPrivate * QQmlContextData::asQQmlContextPrivate ( )
inline

Definition at line 123 of file qqmlcontextdata_p.h.

References QQmlContextPrivate::get().

+ Here is the call graph for this function:

◆ baseUrl()

QUrl QQmlContextData::baseUrl ( ) const
inline

Definition at line 244 of file qqmlcontextdata_p.h.

◆ baseUrlString()

QString QQmlContextData::baseUrlString ( ) const
inline

Definition at line 232 of file qqmlcontextdata_p.h.

◆ childContexts()

QQmlRefPointer< QQmlContextData > QQmlContextData::childContexts ( ) const
inline

Definition at line 205 of file qqmlcontextdata_p.h.

Referenced by QQmlDelegateModelItem::childContextObjectDestroyed().

+ Here is the caller graph for this function:

◆ clearContext()

void QQmlContextData::clearContext ( )

Definition at line 116 of file qqmlcontextdata.cpp.

References emitDestruction(), and QQmlJavaScriptExpression::setContext().

Referenced by clearContextRecursively().

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

◆ clearContextRecursively()

void QQmlContextData::clearContextRecursively ( )

Definition at line 108 of file qqmlcontextdata.cpp.

References clearContext().

+ Here is the call graph for this function:

◆ clearParent()

void QQmlContextData::clearParent ( )
inline

Definition at line 88 of file qqmlcontextdata_p.h.

References release().

Referenced by invalidate().

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

◆ clearPublicContext()

void QQmlContextData::clearPublicContext ( )
inline

Definition at line 157 of file qqmlcontextdata_p.h.

References release().

+ Here is the call graph for this function:

◆ componentAttacheds()

QQmlComponentAttached * QQmlContextData::componentAttacheds ( ) const
inline

Definition at line 286 of file qqmlcontextdata_p.h.

◆ contextObject()

QObject * QQmlContextData::contextObject ( ) const
inline

Definition at line 128 of file qqmlcontextdata_p.h.

Referenced by QQmlDMAbstractItemModelData::modelData().

+ Here is the caller graph for this function:

◆ count()

int QQmlContextData::count ( ) const
inline

Definition at line 53 of file qqmlcontextdata_p.h.

◆ createChild()

static QQmlRefPointer< QQmlContextData > QQmlContextData::createChild ( const QQmlRefPointer< QQmlContextData > & parent)
inlinestatic

Definition at line 44 of file qqmlcontextdata_p.h.

References Q_ASSERT.

Referenced by initProxy().

+ Here is the caller graph for this function:

◆ createRefCounted()

static QQmlRefPointer< QQmlContextData > QQmlContextData::createRefCounted ( const QQmlRefPointer< QQmlContextData > & parent)
inlinestatic

Definition at line 36 of file qqmlcontextdata_p.h.

Referenced by QQmlEnginePrivate::createInternalContext(), and QQmlDelegateModelPrivate::object().

+ Here is the caller graph for this function:

◆ deepClearContextObject() [1/2]

void QQmlContextData::deepClearContextObject ( QObject * contextObject)
inline

Definition at line 145 of file qqmlcontextdata_p.h.

◆ deepClearContextObject() [2/2]

template<typename HandleSelf , typename HandleLinked >
void QQmlContextData::deepClearContextObject ( QObject * contextObject,
HandleSelf && handleSelf,
HandleLinked && handleLinked )
inline

Definition at line 132 of file qqmlcontextdata_p.h.

◆ emitDestruction()

void QQmlContextData::emitDestruction ( )

Definition at line 66 of file qqmlcontextdata.cpp.

References child, QQmlComponentAttached::destruction(), emit, and QQmlComponentAttached::removeFromList().

Referenced by clearContext(), QQmlContextPrivate::emitDestruction(), and invalidate().

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

◆ engine()

QQmlEngine * QQmlContextData::engine ( ) const
inline

Definition at line 153 of file qqmlcontextdata_p.h.

Referenced by QQmlPropertyPrivate::create(), and QQmlVMEMetaObject::metaCall().

+ Here is the caller graph for this function:

◆ extraObject()

QObject * QQmlContextData::extraObject ( ) const
inline

Definition at line 266 of file qqmlcontextdata_p.h.

◆ findObjectId()

QString QQmlContextData::findObjectId ( const QObject * obj) const

Definition at line 270 of file qqmlcontextdata.cpp.

References QMetaType::flags(), QString::fromUtf8(), QVariant::fromValue(), QQmlContextPrivate::get(), i, metaObject(), QMetaProperty::metaType(), QMetaProperty::name(), QMetaType::PointerToQObject, propertyName(), and QMetaProperty::read().

+ Here is the call graph for this function:

◆ get()

◆ hasUnresolvedNames()

bool QQmlContextData::hasUnresolvedNames ( ) const
inline

Definition at line 283 of file qqmlcontextdata_p.h.

◆ idValue()

QObject * QQmlContextData::idValue ( int index) const
inline

Definition at line 218 of file qqmlcontextdata_p.h.

Referenced by QQmlVMEMetaObject::aliasTarget(), QQmlPropertyPrivate::initProperty(), and QQmlVMEMetaObject::metaCall().

+ Here is the caller graph for this function:

◆ idValueBindings()

QQmlNotifier * QQmlContextData::idValueBindings ( int index) const
inline

Definition at line 217 of file qqmlcontextdata_p.h.

Referenced by QQmlVMEMetaObject::connectAlias().

+ Here is the caller graph for this function:

◆ importedScripts()

QV4::PersistentValue QQmlContextData::importedScripts ( ) const
inline

Definition at line 277 of file qqmlcontextdata_p.h.

◆ imports()

QQmlRefPointer< QQmlTypeNameCache > QQmlContextData::imports ( ) const
inline

Definition at line 255 of file qqmlcontextdata_p.h.

Referenced by QQmlBindPrivate::decodeBinding(), and QQmlPropertyPrivate::initProperty().

+ Here is the caller graph for this function:

◆ incubator()

QQmlIncubatorPrivate * QQmlContextData::incubator ( ) const
inline

Definition at line 258 of file qqmlcontextdata_p.h.

References nullptr.

Referenced by QQmlIncubatorPrivate::clear().

+ Here is the caller graph for this function:

◆ initFromTypeCompilationUnit()

void QQmlContextData::initFromTypeCompilationUnit ( const QQmlRefPointer< QV4::ExecutableCompilationUnit > & unit,
int subComponentIndex )

Definition at line 303 of file qqmlcontextdata.cpp.

References QV4::CompiledData::Object::nNamedObjectsInComponent, QV4::ExecutableCompilationUnit::objectAt(), and Q_ASSERT.

Referenced by QQmlEnginePrivate::createInternalContext().

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

◆ installContext()

QT_BEGIN_NAMESPACE void QQmlContextData::installContext ( QQmlData * ddata,
QQmlContextData::QmlObjectKind kind )

Definition at line 13 of file qqmlcontextdata.cpp.

References addOwnedObject(), DocumentRoot, and Q_ASSERT.

+ Here is the call graph for this function:

◆ invalidate()

void QQmlContextData::invalidate ( )

Definition at line 86 of file qqmlcontextdata.cpp.

References QV4::PersistentValue::clear(), clearParent(), emitDestruction(), invalidate(), and Q_ASSERT.

Referenced by invalidate().

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

◆ isIdValueSet()

bool QQmlContextData::isIdValueSet ( int index) const
inline

Definition at line 216 of file qqmlcontextdata_p.h.

◆ isInternal()

bool QQmlContextData::isInternal ( ) const
inline

Definition at line 78 of file qqmlcontextdata_p.h.

◆ isJSContext()

bool QQmlContextData::isJSContext ( ) const
inline

Definition at line 81 of file qqmlcontextdata_p.h.

◆ isPragmaLibraryContext()

bool QQmlContextData::isPragmaLibraryContext ( ) const
inline

Definition at line 84 of file qqmlcontextdata_p.h.

◆ isRootObjectInCreation()

bool QQmlContextData::isRootObjectInCreation ( ) const
inline

Definition at line 274 of file qqmlcontextdata_p.h.

◆ isValid()

bool QQmlContextData::isValid ( ) const
inline

Definition at line 72 of file qqmlcontextdata_p.h.

References QObjectPrivate::get().

Referenced by QQmlContextPrivate::dropDestroyedQObject(), and QQmlVMEMetaObject::method().

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

◆ linkedContext()

QQmlRefPointer< QQmlContextData > QQmlContextData::linkedContext ( ) const
inline

Definition at line 280 of file qqmlcontextdata_p.h.

◆ nextChild()

QQmlRefPointer< QQmlContextData > QQmlContextData::nextChild ( ) const
inline

Definition at line 212 of file qqmlcontextdata_p.h.

◆ numIdValues()

int QQmlContextData::numIdValues ( ) const
inline

Definition at line 214 of file qqmlcontextdata_p.h.

◆ ownedObjects()

QQmlData * QQmlContextData::ownedObjects ( ) const
inline

Definition at line 103 of file qqmlcontextdata_p.h.

Referenced by QQmlData::destroyed().

+ Here is the caller graph for this function:

◆ parent()

QQmlRefPointer< QQmlContextData > QQmlContextData::parent ( ) const
inline

Definition at line 87 of file qqmlcontextdata_p.h.

Referenced by QtQuickPrivate::beginDeferred(), initCreator(), QQmlPropertyPrivate::initProperty(), and resolvedUrl().

+ Here is the caller graph for this function:

◆ propertyIndex() [1/2]

int QQmlContextData::propertyIndex ( const QString & name) const
inline

Definition at line 169 of file qqmlcontextdata_p.h.

Referenced by QQmlContextPrivate::dropDestroyedQObject().

+ Here is the caller graph for this function:

◆ propertyIndex() [2/2]

int QQmlContextData::propertyIndex ( QV4::String * name) const
inline

Definition at line 175 of file qqmlcontextdata_p.h.

◆ propertyName()

QString QQmlContextData::propertyName ( int index) const
inline

Definition at line 181 of file qqmlcontextdata_p.h.

Referenced by findObjectId().

+ Here is the caller graph for this function:

◆ publicContext()

QQmlContext * QQmlContextData::publicContext ( ) const
inline

Definition at line 156 of file qqmlcontextdata_p.h.

◆ refCount()

int QQmlContextData::refCount ( ) const
inline

Definition at line 54 of file qqmlcontextdata_p.h.

◆ refreshExpressions()

void QQmlContextData::refreshExpressions ( )

Definition at line 227 of file qqmlcontextdata.cpp.

References QQmlGuardedContextData::isNull().

+ Here is the call graph for this function:

◆ release()

void QQmlContextData::release ( ) const
inline

Definition at line 52 of file qqmlcontextdata_p.h.

◆ resolvedUrl()

QUrl QQmlContextData::resolvedUrl ( const QUrl & src) const

Definition at line 36 of file qqmlcontextdata.cpp.

References QQmlEngine::baseUrl(), QQmlEngine::interceptUrl(), QUrl::isEmpty(), parent(), QUrl::resolved(), url(), QUrl::url(), and QQmlAbstractUrlInterceptor::UrlString.

Referenced by QQmlPropertyPrivate::write().

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

◆ setBaseUrl()

void QQmlContextData::setBaseUrl ( const QUrl & baseUrl)
inline

Definition at line 243 of file qqmlcontextdata_p.h.

References baseUrl.

◆ setBaseUrlString()

void QQmlContextData::setBaseUrlString ( const QString & baseUrlString)
inline

Definition at line 231 of file qqmlcontextdata_p.h.

◆ setChildContexts()

void QQmlContextData::setChildContexts ( const QQmlRefPointer< QQmlContextData > & childContexts)
inline

Definition at line 201 of file qqmlcontextdata_p.h.

◆ setContextObject()

void QQmlContextData::setContextObject ( QObject * contextObject)
inline

Definition at line 129 of file qqmlcontextdata_p.h.

Referenced by QQDMIncubationTask::initializeRequiredProperties().

+ Here is the caller graph for this function:

◆ setEngine()

void QQmlContextData::setEngine ( QQmlEngine * engine)
inline

Definition at line 154 of file qqmlcontextdata_p.h.

References engine.

◆ setExpressions()

void QQmlContextData::setExpressions ( QQmlJavaScriptExpression * expressions)
inline

Definition at line 193 of file qqmlcontextdata_p.h.

◆ setExtraObject()

void QQmlContextData::setExtraObject ( QObject * extraObject)
inline

Definition at line 267 of file qqmlcontextdata_p.h.

References Q_ASSERT.

◆ setIdValue()

void QQmlContextData::setIdValue ( int index,
QObject * idValue )

Definition at line 264 of file qqmlcontextdata.cpp.

◆ setImportedScripts()

void QQmlContextData::setImportedScripts ( const QV4::PersistentValue & scripts)
inline

Definition at line 278 of file qqmlcontextdata_p.h.

Referenced by QQmlEnginePrivate::createInternalContext().

+ Here is the caller graph for this function:

◆ setImports()

void QQmlContextData::setImports ( const QQmlRefPointer< QQmlTypeNameCache > & imports)
inline

Definition at line 256 of file qqmlcontextdata_p.h.

Referenced by QQmlEnginePrivate::createInternalContext().

+ Here is the caller graph for this function:

◆ setIncubator()

void QQmlContextData::setIncubator ( QQmlIncubatorPrivate * incubator)
inline

Definition at line 259 of file qqmlcontextdata_p.h.

References Q_ASSERT.

Referenced by QQmlIncubatorPrivate::clear().

+ Here is the caller graph for this function:

◆ setInternal()

void QQmlContextData::setInternal ( bool isInternal)
inline

Definition at line 79 of file qqmlcontextdata_p.h.

Referenced by QQmlEnginePrivate::createInternalContext().

+ Here is the caller graph for this function:

◆ setJSContext()

void QQmlContextData::setJSContext ( bool isJSContext)
inline

Definition at line 82 of file qqmlcontextdata_p.h.

◆ setLinkedContext()

void QQmlContextData::setLinkedContext ( const QQmlRefPointer< QQmlContextData > & context)
inline

Definition at line 281 of file qqmlcontextdata_p.h.

References context.

◆ setOwnedObjects()

void QQmlContextData::setOwnedObjects ( QQmlData * ownedObjects)
inline

Definition at line 104 of file qqmlcontextdata_p.h.

Referenced by QQmlData::destroyed().

+ Here is the caller graph for this function:

◆ setPragmaLibraryContext()

void QQmlContextData::setPragmaLibraryContext ( bool library)
inline

Definition at line 85 of file qqmlcontextdata_p.h.

◆ setRootObjectInCreation()

void QQmlContextData::setRootObjectInCreation ( bool rootInCreation)
inline

Definition at line 275 of file qqmlcontextdata_p.h.

◆ setUnresolvedNames()

void QQmlContextData::setUnresolvedNames ( bool hasUnresolvedNames)
inline

Definition at line 284 of file qqmlcontextdata_p.h.

◆ takeChildContexts()

QQmlRefPointer< QQmlContextData > QQmlContextData::takeChildContexts ( )
inline

Definition at line 206 of file qqmlcontextdata_p.h.

◆ takeExpressions()

QQmlJavaScriptExpression * QQmlContextData::takeExpressions ( )
inline

Definition at line 194 of file qqmlcontextdata_p.h.

◆ typeCompilationUnit()

QQmlRefPointer< QV4::ExecutableCompilationUnit > QQmlContextData::typeCompilationUnit ( ) const
inline

Definition at line 56 of file qqmlcontextdata_p.h.

◆ url()

QUrl QQmlContextData::url ( ) const

Definition at line 332 of file qqmlcontextdata.cpp.

References QV4::ExecutableCompilationUnit::finalUrl().

Referenced by resolvedUrl().

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

◆ urlString()

QString QQmlContextData::urlString ( ) const

Definition at line 339 of file qqmlcontextdata.cpp.

References QV4::ExecutableCompilationUnit::finalUrlString().

+ Here is the call graph for this function:

◆ valueTypesAreAddressable()

bool QQmlContextData::valueTypesAreAddressable ( ) const
inline

Definition at line 291 of file qqmlcontextdata_p.h.

Friends And Related Symbol Documentation

◆ QQmlContextPrivate

friend class QQmlContextPrivate
friend

Definition at line 297 of file qqmlcontextdata_p.h.

◆ QQmlGuardedContextData

friend class QQmlGuardedContextData
friend

Definition at line 296 of file qqmlcontextdata_p.h.

Member Data Documentation

◆ m_extraObject

QObject* QQmlContextData::m_extraObject

Definition at line 394 of file qqmlcontextdata_p.h.

◆ m_incubator

QQmlIncubatorPrivate* QQmlContextData::m_incubator

Definition at line 392 of file qqmlcontextdata_p.h.


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