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
QQmlPropertyCache Class Referencefinal

#include <qqmlpropertycache_p.h>

+ Inheritance diagram for QQmlPropertyCache:
+ Collaboration diagram for QQmlPropertyCache:

Classes

struct  ConstPtr
 

Public Types

using Ptr = QQmlRefPointer<QQmlPropertyCache>
 

Public Member Functions

 QQmlPropertyCache ()=default
 
 ~QQmlPropertyCache ()
 
void update (const QMetaObject *)
 
void invalidate (const QMetaObject *)
 
QQmlPropertyCache::Ptr copy () const
 
QQmlPropertyCache::Ptr copyAndAppend (const QMetaObject *, QTypeRevision typeVersion, QQmlPropertyData::Flags propertyFlags=QQmlPropertyData::Flags(), QQmlPropertyData::Flags methodFlags=QQmlPropertyData::Flags(), QQmlPropertyData::Flags signalFlags=QQmlPropertyData::Flags()) const
 
QQmlPropertyCache::Ptr copyAndReserve (int propertyCount, int methodCount, int signalCount, int enumCount) const
 
void appendProperty (const QString &, QQmlPropertyData::Flags flags, int coreIndex, QMetaType propType, QTypeRevision revision, int notifyIndex)
 
void appendSignal (const QString &, QQmlPropertyData::Flags, int coreIndex, const QMetaType *types=nullptr, const QList< QByteArray > &names=QList< QByteArray >())
 
void appendMethod (const QString &, QQmlPropertyData::Flags flags, int coreIndex, QMetaType returnType, const QList< QByteArray > &names, const QVector< QMetaType > &parameterTypes)
 
void appendEnum (const QString &, const QVector< QQmlEnumValue > &)
 
const QMetaObjectmetaObject () const
 
const QMetaObjectcreateMetaObject () const
 
const QMetaObjectfirstCppMetaObject () const
 
template<typename K >
const QQmlPropertyDataproperty (const K &key, QObject *object, const QQmlRefPointer< QQmlContextData > &context) const
 
const QQmlPropertyDataproperty (int) const
 
const QQmlPropertyDatamaybeUnresolvedProperty (int) const
 
const QQmlPropertyDatamethod (int) const
 
const QQmlPropertyDatasignal (int index) const
 
QQmlEnumDataqmlEnum (int) const
 
int methodIndexToSignalIndex (int) const
 
QString defaultPropertyName () const
 
const QQmlPropertyDatadefaultProperty () const
 
const QQmlPropertyCache::ConstPtrparent () const
 
void setParent (QQmlPropertyCache::ConstPtr newParent)
 
const QQmlPropertyDataoverrideData (const QQmlPropertyData *) const
 
bool isAllowedInRevision (const QQmlPropertyData *) const
 
int originalClone (int index) const
 
QList< QByteArraysignalParameterNames (int index) const
 
const char * className () const
 
int propertyCount () const
 
int propertyOffset () const
 
int methodCount () const
 
int methodOffset () const
 
int signalCount () const
 
int signalOffset () const
 
int qmlEnumCount () const
 
void toMetaObjectBuilder (QMetaObjectBuilder &) const
 
bool callJSFactoryMethod (QObject *object, void **args) const
 
QByteArray checksum (QHash< quintptr, QByteArray > *checksums, bool *ok) const
 
QTypeRevision allowedRevision (int index) const
 
void setAllowedRevision (int index, QTypeRevision allowed)
 
- Public Member Functions inherited from QQmlRefCounted< QQmlPropertyCache >
void release () const
 
- Public Member Functions inherited from QQmlRefCount
 QQmlRefCount ()
 
void addref () const
 
int count () const
 

Static Public Member Functions

static Ptr createStandalone (const QMetaObject *, QTypeRevision metaObjectRevision=QTypeRevision::zero())
 Creates a standalone QQmlPropertyCache of metaObject.
 
static const QQmlPropertyDataproperty (QObject *, QStringView, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData *)
 
static const QQmlPropertyDataproperty (QObject *, const QLatin1String &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData *)
 
static const QQmlPropertyDataproperty (QObject *, const QV4::String *, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData *)
 
static int originalClone (const QObject *, int index)
 
static QString signalParameterStringForJS (QV4::ExecutionEngine *engine, const QList< QByteArray > &parameterNameList, QString *errorString=nullptr)
 
static bool determineMetaObjectSizes (const QMetaObject &mo, int *fieldCount, int *stringCount)
 
static bool addToHash (QCryptographicHash &hash, const QMetaObject &mo)
 

Friends

class QQmlEnginePrivate
 
class QQmlCompiler
 
template<typename T >
class QQmlPropertyCacheCreator
 
template<typename T >
class QQmlPropertyCacheAliasCreator
 
template<typename T >
class QQmlComponentAndAliasResolver
 
class QQmlMetaObject
 

Additional Inherited Members

- Protected Member Functions inherited from QQmlRefCounted< QQmlPropertyCache >
 ~QQmlRefCounted ()
 

Detailed Description

Definition at line 119 of file qqmlpropertycache_p.h.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ QQmlPropertyCache()

QQmlPropertyCache::QQmlPropertyCache ( )
default

Referenced by createStandalone().

+ Here is the caller graph for this function:

◆ ~QQmlPropertyCache()

QQmlPropertyCache::~QQmlPropertyCache ( )

Definition at line 160 of file qqmlpropertycache.cpp.

References args, QLinkedStringHash< T >::clear(), and next.

+ Here is the call graph for this function:

Member Function Documentation

◆ addToHash()

bool QQmlPropertyCache::addToHash ( QCryptographicHash & hash,
const QMetaObject & mo )
static

Definition at line 1213 of file qqmlpropertycache.cpp.

References determineMetaObjectSizes(), hash, i, mo, and stringData().

Referenced by checksum().

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

◆ allowedRevision()

QTypeRevision QQmlPropertyCache::allowedRevision ( int index) const
inline

Definition at line 228 of file qqmlpropertycache_p.h.

◆ appendEnum()

void QQmlPropertyCache::appendEnum ( const QString & name,
const QVector< QQmlEnumValue > & values )

Definition at line 299 of file qqmlpropertycache.cpp.

References QQmlEnumData::name.

◆ appendMethod()

void QQmlPropertyCache::appendMethod ( const QString & name,
QQmlPropertyData::Flags flags,
int coreIndex,
QMetaType returnType,
const QList< QByteArray > & names,
const QVector< QMetaType > & parameterTypes )

Definition at line 272 of file qqmlpropertycache.cpp.

References args, methodOffset(), and QQmlPropertyData::setPropType().

+ Here is the call graph for this function:

◆ appendProperty()

void QQmlPropertyCache::appendProperty ( const QString & name,
QQmlPropertyData::Flags flags,
int coreIndex,
QMetaType propType,
QTypeRevision version,
int notifyIndex )

notifyIndex MUST be in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex().

Definition at line 213 of file qqmlpropertycache.cpp.

References propertyOffset(), and QQmlPropertyData::setPropType().

Referenced by QQmlPropertyCacheAliasCreator< ObjectContainer >::appendAliasesToPropertyCache().

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

◆ appendSignal()

void QQmlPropertyCache::appendSignal ( const QString & name,
QQmlPropertyData::Flags flags,
int coreIndex,
const QMetaType * types = nullptr,
const QList< QByteArray > & names = QList<QByteArray>() )

Definition at line 234 of file qqmlpropertycache.cpp.

References args, methodOffset(), QQmlPropertyData::Flags::setIsSignalHandler(), QQmlPropertyData::setPropType(), QQmlSignalNames::signalNameToHandlerName(), and signalOffset().

+ Here is the call graph for this function:

◆ callJSFactoryMethod()

bool QQmlPropertyCache::callJSFactoryMethod ( QObject * object,
void ** args ) const
inline

Definition at line 469 of file qqmlpropertycache_p.h.

References args, QMetaObject::InvokeMetaMethod, QQmlMetaObjectPointer::metaObject(), and mo.

+ Here is the call graph for this function:

◆ checksum()

QByteArray QQmlPropertyCache::checksum ( QHash< quintptr, QByteArray > * checksums,
bool * ok ) const

Definition at line 1229 of file qqmlpropertycache.cpp.

References addToHash(), QSet< T >::constEnd(), QSet< T >::constFind(), hash, QQmlMetaObjectPointer::isShared(), it, QCryptographicHash::Md5, QQmlMetaObjectPointer::metaObject(), ok, and QByteArray().

+ Here is the call graph for this function:

◆ className()

const char * QQmlPropertyCache::className ( ) const

Definition at line 926 of file qqmlpropertycache.cpp.

References QByteArray::constData(), QQmlMetaObjectPointer::metaObject(), and mo.

+ Here is the call graph for this function:

◆ copy()

QQmlPropertyCache::Ptr QQmlPropertyCache::copy ( ) const

Definition at line 191 of file qqmlpropertycache.cpp.

References copy().

Referenced by copy(), copyAndAppend(), and copyAndReserve().

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

◆ copyAndAppend()

QQmlPropertyCache::Ptr QQmlPropertyCache::copyAndAppend ( const QMetaObject * metaObject,
QTypeRevision typeVersion,
QQmlPropertyData::Flags propertyFlags = QQmlPropertyData::Flags(),
QQmlPropertyData::Flags methodFlags = QQmlPropertyData::Flags(),
QQmlPropertyData::Flags signalFlags = QQmlPropertyData::Flags() ) const

Definition at line 345 of file qqmlpropertycache.cpp.

References copy(), QMetaObjectPrivate::get(), metaObject(), methodCount(), propertyCount(), Q_ASSERT, and signalCount().

+ Here is the call graph for this function:

◆ copyAndReserve()

QQmlPropertyCache::Ptr QQmlPropertyCache::copyAndReserve ( int propertyCount,
int methodCount,
int signalCount,
int enumCount ) const

Definition at line 196 of file qqmlpropertycache.cpp.

References copy(), methodCount(), propertyCount(), and signalCount().

+ Here is the call graph for this function:

◆ createMetaObject()

const QMetaObject * QQmlPropertyCache::createMetaObject ( ) const

Definition at line 308 of file qqmlpropertycache.cpp.

References QQmlMetaObjectPointer::isNull(), QQmlMetaObjectPointer::metaObject(), QQmlMetaObjectPointer::setSharedOnce(), QMetaObjectBuilder::setSuperClass(), QMetaObjectBuilder::toMetaObject(), and toMetaObjectBuilder().

+ Here is the call graph for this function:

◆ createStandalone()

QQmlPropertyCache::Ptr QQmlPropertyCache::createStandalone ( const QMetaObject * metaObject,
QTypeRevision metaObjectRevision = QTypeRevision::zero() )
static

Creates a standalone QQmlPropertyCache of metaObject.

It is separate from the usual QQmlPropertyCache hierarchy. It's parent is not equal to any other QQmlPropertyCache created from QObject::staticMetaObject, for example.

Definition at line 131 of file qqmlpropertycache.cpp.

References QQmlPropertyCache(), createStandalone(), QTypeRevision::isValid(), metaObject(), Q_ASSERT, QMetaObject::superClass(), and QTypeRevision::zero().

Referenced by createStandalone(), VDMAbstractItemModelDataType::initializeMetaType(), QQmlMetaTypeData::propertyCache(), QQmlOpenMetaObject::setCached(), and VDMListDelegateDataType::toDynamicMetaObject().

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

◆ defaultProperty()

const QQmlPropertyData * QQmlPropertyCache::defaultProperty ( ) const

Definition at line 333 of file qqmlpropertycache.cpp.

References defaultPropertyName(), and property.

+ Here is the call graph for this function:

◆ defaultPropertyName()

QString QQmlPropertyCache::defaultPropertyName ( ) const
inline

Definition at line 391 of file qqmlpropertycache_p.h.

Referenced by defaultProperty().

+ Here is the caller graph for this function:

◆ determineMetaObjectSizes()

bool QQmlPropertyCache::determineMetaObjectSizes ( const QMetaObject & mo,
int * fieldCount,
int * stringCount )
static

Definition at line 1195 of file qqmlpropertycache.cpp.

References mo, QMetaObjectPrivate::OutputRevision, priv(), and qMax().

Referenced by addToHash().

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

◆ firstCppMetaObject()

const QMetaObject * QQmlPropertyCache::firstCppMetaObject ( ) const
inline

Definition at line 324 of file qqmlpropertycache_p.h.

References QQmlRefPointer< T >::data(), QQmlMetaObjectPointer::metaObject(), and parent().

Referenced by signalParameterNames().

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

◆ invalidate()

void QQmlPropertyCache::invalidate ( const QMetaObject * metaObject)

invalidates and updates the PropertyCache if the QMetaObject has changed. This function is used in the tooling to update dynamic properties.

Definition at line 577 of file qqmlpropertycache.cpp.

References QLinkedStringHash< T >::linkAndReserve(), metaObject(), metaObjectSignalCount(), QMetaObject::methodCount(), parent(), QMetaObject::propertyCount(), reserve(), and update().

Referenced by QQmlDesignerMetaObject::createNewDynamicProperty().

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

◆ isAllowedInRevision()

bool QQmlPropertyCache::isAllowedInRevision ( const QQmlPropertyData * data) const
inline

Definition at line 413 of file qqmlpropertycache_p.h.

References QTypeRevision::hasMajorVersion(), QTypeRevision::hasMinorVersion(), QTypeRevision::majorVersion(), QTypeRevision::minorVersion(), Q_ASSERT, and QTypeRevision::zero().

+ Here is the call graph for this function:

◆ maybeUnresolvedProperty()

const QQmlPropertyData * QQmlPropertyCache::maybeUnresolvedProperty ( int index) const

Definition at line 320 of file qqmlpropertycache.cpp.

References propertyCount().

+ Here is the call graph for this function:

◆ metaObject()

const QMetaObject * QQmlPropertyCache::metaObject ( ) const
inline

Definition at line 317 of file qqmlpropertycache_p.h.

References QQmlMetaObjectPointer::metaObject().

Referenced by QQmlPropertyCapture::captureProperty(), copyAndAppend(), createStandalone(), invalidate(), and update().

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

◆ method()

const QQmlPropertyData * QQmlPropertyCache::method ( int index) const
inline

Definition at line 343 of file qqmlpropertycache_p.h.

◆ methodCount()

int QQmlPropertyCache::methodCount ( ) const
inline

Definition at line 444 of file qqmlpropertycache_p.h.

Referenced by copyAndAppend(), and copyAndReserve().

+ Here is the caller graph for this function:

◆ methodIndexToSignalIndex()

int QQmlPropertyCache::methodIndexToSignalIndex ( int index) const
inline

Definition at line 379 of file qqmlpropertycache_p.h.

◆ methodOffset()

int QQmlPropertyCache::methodOffset ( ) const
inline

Definition at line 449 of file qqmlpropertycache_p.h.

Referenced by appendMethod(), and appendSignal().

+ Here is the caller graph for this function:

◆ originalClone() [1/2]

int QQmlPropertyCache::originalClone ( const QObject * object,
int index )
static

Definition at line 775 of file qqmlpropertycache.cpp.

References cache, QMetaMethod::Cloned, QQmlData::get(), QQmlPropertyData::isCloned(), and QMetaObjectPrivate::signal().

+ Here is the call graph for this function:

◆ originalClone() [2/2]

int QQmlPropertyCache::originalClone ( int index) const

Definition at line 768 of file qqmlpropertycache.cpp.

References signal.

Referenced by QQmlBoundSignal::QQmlBoundSignal().

+ Here is the caller graph for this function:

◆ overrideData()

const QQmlPropertyData * QQmlPropertyCache::overrideData ( const QQmlPropertyData * data) const
inline

Definition at line 402 of file qqmlpropertycache_p.h.

References method, and property.

Referenced by toMetaObjectBuilder().

+ Here is the caller graph for this function:

◆ parent()

const QQmlPropertyCache::ConstPtr & QQmlPropertyCache::parent ( ) const
inline

Definition at line 396 of file qqmlpropertycache_p.h.

Referenced by firstCppMetaObject(), and invalidate().

+ Here is the caller graph for this function:

◆ property() [1/5]

template<typename K >
const QQmlPropertyData * QQmlPropertyCache::property ( const K & key,
QObject * object,
const QQmlRefPointer< QQmlContextData > & context ) const
inline

Definition at line 169 of file qqmlpropertycache_p.h.

References context.

Referenced by QQmlListReference::QQmlListReference(), QV4::QObjectWrapper::findProperty(), QQmlPrivate::initObjectLookup(), QQmlPropertyPrivate::initProperty(), readObjectProperty(), QV4::QObjectWrapper::setQmlProperty(), and QV4::QObjectWrapper::virtualResolveLookupGetter().

+ Here is the caller graph for this function:

◆ property() [2/5]

const QQmlPropertyData * QQmlPropertyCache::property ( int index) const
inline

Definition at line 332 of file qqmlpropertycache_p.h.

References propertyCount().

+ Here is the call graph for this function:

◆ property() [3/5]

const QQmlPropertyData * QQmlPropertyCache::property ( QObject * obj,
const QLatin1String & name,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData * local )
static

Definition at line 910 of file qqmlpropertycache.cpp.

References context.

◆ property() [4/5]

const QQmlPropertyData * QQmlPropertyCache::property ( QObject * obj,
const QV4::String * name,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData * local )
static

Definition at line 896 of file qqmlpropertycache.cpp.

References context.

◆ property() [5/5]

const QQmlPropertyData * QQmlPropertyCache::property ( QObject * obj,
QStringView name,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData * local )
static

Definition at line 903 of file qqmlpropertycache.cpp.

References context.

◆ propertyCount()

int QQmlPropertyCache::propertyCount ( ) const
inline

Definition at line 434 of file qqmlpropertycache_p.h.

Referenced by copyAndAppend(), copyAndReserve(), maybeUnresolvedProperty(), and property().

+ Here is the caller graph for this function:

◆ propertyOffset()

int QQmlPropertyCache::propertyOffset ( ) const
inline

Definition at line 439 of file qqmlpropertycache_p.h.

Referenced by appendProperty().

+ Here is the caller graph for this function:

◆ qmlEnum()

QQmlEnumData * QQmlPropertyCache::qmlEnum ( int index) const
inline

Definition at line 371 of file qqmlpropertycache_p.h.

◆ qmlEnumCount()

int QQmlPropertyCache::qmlEnumCount ( ) const
inline

Definition at line 464 of file qqmlpropertycache_p.h.

◆ setAllowedRevision()

void QQmlPropertyCache::setAllowedRevision ( int index,
QTypeRevision allowed )
inline

Definition at line 229 of file qqmlpropertycache_p.h.

◆ setParent()

void QQmlPropertyCache::setParent ( QQmlPropertyCache::ConstPtr newParent)

Definition at line 338 of file qqmlpropertycache.cpp.

◆ signal()

const QQmlPropertyData * QQmlPropertyCache::signal ( int index) const
inline

index MUST be in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex().

Definition at line 358 of file qqmlpropertycache_p.h.

References Q_ASSERT.

◆ signalCount()

int QQmlPropertyCache::signalCount ( ) const
inline

Definition at line 454 of file qqmlpropertycache_p.h.

Referenced by copyAndAppend(), and copyAndReserve().

+ Here is the caller graph for this function:

◆ signalOffset()

int QQmlPropertyCache::signalOffset ( ) const
inline

Definition at line 459 of file qqmlpropertycache_p.h.

Referenced by appendSignal().

+ Here is the caller graph for this function:

◆ signalParameterNames()

QList< QByteArray > QQmlPropertyCache::signalParameterNames ( int index) const

index MUST be in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex().

Definition at line 1270 of file qqmlpropertycache.cpp.

References args, firstCppMetaObject(), method, QMetaObjectPrivate::signal(), and signal.

+ Here is the call graph for this function:

◆ signalParameterStringForJS()

QString QQmlPropertyCache::signalParameterStringForJS ( QV4::ExecutionEngine * engine,
const QList< QByteArray > & parameterNameList,
QString * errorString = nullptr )
static

Definition at line 737 of file qqmlpropertycache.cpp.

References QByteArray::at(), QQmlRefCount::count(), engine, QString::fromUtf8(), i, QString::size(), and QCoreApplication::translate().

Referenced by Q_TRACE_POINT(), and QQmlBoundSignal_callback().

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

◆ toMetaObjectBuilder()

void QQmlPropertyCache::toMetaObjectBuilder ( QMetaObjectBuilder & builder) const

Definition at line 934 of file qqmlpropertycache.cpp.

References QMetaObjectBuilder::addClassInfo(), QMetaObjectBuilder::addEnumerator(), QMetaEnumBuilder::addKey(), QMetaObjectBuilder::addProperty(), QMetaObjectBuilder::addSignal(), QMetaObjectBuilder::addSlot(), arguments, QLinkedStringHash< T >::begin(), QLinkedStringHash< T >::end(), QByteArray::isEmpty(), QString::isEmpty(), iter, method, methods, overrideData(), properties, property, QMetaMethod::Public, Q_ASSERT, qMakePair(), QMetaObjectBuilder::setClassName(), QMetaEnumBuilder::setIsScoped(), QMetaPropertyBuilder::setReadable(), QList< T >::size(), and QString::toUtf8().

Referenced by createMetaObject().

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

◆ update()

void QQmlPropertyCache::update ( const QMetaObject * metaObject)

Definition at line 550 of file qqmlpropertycache.cpp.

References QLinkedStringHash< T >::clear(), metaObject(), metaObjectSignalCount(), QMetaObject::methodCount(), QMetaObject::propertyCount(), and Q_ASSERT.

Referenced by QQmlOpenMetaObjectType::createProperties(), QQmlOpenMetaObjectType::createProperty(), and invalidate().

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

Friends And Related Symbol Documentation

◆ QQmlCompiler

friend class QQmlCompiler
friend

Definition at line 233 of file qqmlpropertycache_p.h.

◆ QQmlComponentAndAliasResolver

template<typename T >
friend class QQmlComponentAndAliasResolver
friend

Definition at line 236 of file qqmlpropertycache_p.h.

◆ QQmlEnginePrivate

friend class QQmlEnginePrivate
friend

Definition at line 232 of file qqmlpropertycache_p.h.

◆ QQmlMetaObject

friend class QQmlMetaObject
friend

Definition at line 237 of file qqmlpropertycache_p.h.

◆ QQmlPropertyCacheAliasCreator

template<typename T >
friend class QQmlPropertyCacheAliasCreator
friend

Definition at line 235 of file qqmlpropertycache_p.h.

◆ QQmlPropertyCacheCreator

template<typename T >
friend class QQmlPropertyCacheCreator
friend

Definition at line 234 of file qqmlpropertycache_p.h.


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