Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQmlPropertyPrivate Class Referencefinal

#include <qqmlproperty_p.h>

Inheritance diagram for QQmlPropertyPrivate:
Collaboration diagram for QQmlPropertyPrivate:

Classes

struct  ResolvedAlias

Public Types

enum class  InitFlag { None = 0x0 , AllowId = 0x1 , AllowSignal = 0x2 }
enum  BindingFlag { None = 0 , DontEnable = 0x1 , OverrideSticky = 0x2 }

Public Member Functions

 Q_DECLARE_FLAGS (InitFlags, InitFlag)
 QQmlPropertyPrivate ()
QQmlPropertyIndex encodedIndex () const
QQmlRefPointer< QQmlContextDataeffectiveContext () const
void initProperty (QObject *obj, const QString &name, InitFlags flags=InitFlag::None)
void initDefault (QObject *obj)
 Initialize from the default property of obj.
bool isValueType () const
QMetaType propertyType () const
QQmlProperty::Type type () const
QQmlProperty::PropertyTypeCategory propertyTypeCategory () const
QVariant readValueProperty ()
bool writeValueProperty (const QVariant &, QQmlPropertyData::WriteFlags)
int signalIndex () const
Public Member Functions inherited from QQmlRefCounted< QQmlPropertyPrivate >
void release () const
Public Member Functions inherited from QQmlRefCount
 QQmlRefCount ()
void addref () const
int count () const

Static Public Member Functions

static bool resolveUrlsOnAssignment ()
static QQmlPropertyIndex encodedIndex (const QQmlPropertyData &core, const QQmlPropertyData &valueTypeData)
static QQmlMetaObject rawMetaObjectForType (QMetaType metaType)
static bool writeEnumProperty (const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags)
static bool writeValueProperty (QObject *, const QQmlPropertyData &, const QQmlPropertyData &valueTypeData, const QVariant &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
static bool resetValueProperty (QObject *, const QQmlPropertyData &, const QQmlPropertyData &valueTypeData, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
static bool write (QObject *, const QQmlPropertyData &, const QVariant &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
static bool reset (QObject *, const QQmlPropertyData &, QQmlPropertyData::WriteFlags flags={})
static void findAliasTarget (QObject *, QQmlPropertyIndex, QObject **, QQmlPropertyIndex *)
static ResolvedAlias findAliasTarget (QObject *baseObject, QQmlPropertyIndex baseIndex)
static void setBinding (QQmlAbstractBinding *binding, BindingFlags flags=None, QQmlPropertyData::WriteFlags writeFlags=QQmlPropertyData::DontRemoveBinding)
static bool removeBinding (const QQmlProperty &that, BindingFlags flags=None)
static bool removeBinding (QObject *o, QQmlPropertyIndex index, BindingFlags flags=None)
static bool removeBinding (QQmlAbstractBinding *b, QQmlPropertyPrivate::BindingFlags flags=None)
static QQmlAbstractBindingbinding (QObject *, QQmlPropertyIndex index)
static QQmlProperty restore (QObject *, const QQmlPropertyData &, const QQmlPropertyData *, const QQmlRefPointer< QQmlContextData > &)
static QQmlPropertyPrivateget (const QQmlProperty &p)
static QQmlAbstractBindingbinding (const QQmlProperty &that)
 Returns the binding associated with this property, or 0 if no binding exists.
static void setBinding (const QQmlProperty &that, QQmlAbstractBinding *)
 Set the binding associated with this property to newBinding.
static QQmlBoundSignalExpressionsignalExpression (const QQmlProperty &that)
 Returns the expression associated with this signal property, or 0 if no signal expression exists.
static void setSignalExpression (const QQmlProperty &that, QQmlBoundSignalExpression *)
 Set the signal expression associated with this signal property to expr.
static void takeSignalExpression (const QQmlProperty &that, QQmlBoundSignalExpression *)
 Set the signal expression associated with this signal property to expr.
static bool write (const QQmlProperty &that, const QVariant &, QQmlPropertyData::WriteFlags)
static QQmlPropertyIndex propertyIndex (const QQmlProperty &that)
static QMetaMethod findSignalByName (const QMetaObject *mo, const QByteArray &)
 Return the signal corresponding to name.
static QMetaProperty findPropertyByName (const QMetaObject *mo, const QByteArray &)
 Return the property corresponding to name.
static bool connect (const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=nullptr)
 Connect sender signal_index to receiver method_index with the specified type and types.
static void flushSignal (const QObject *sender, int signal_index)
static QList< QUrlurlSequence (const QVariant &value)
static QList< QUrlurlSequence (const QVariant &value, const QQmlRefPointer< QQmlContextData > &ctxt)
static QQmlProperty create (QObject *target, const QString &propertyName, const QQmlRefPointer< QQmlContextData > &context, QQmlPropertyPrivate::InitFlags flags)

Public Attributes

QQmlRefPointer< QQmlContextDatacontext
QPointer< QQmlEngineengine
QPointer< QObjectobject
QQmlPropertyData core
QQmlPropertyData valueTypeData
QString nameCache

Additional Inherited Members

Protected Member Functions inherited from QQmlRefCounted< QQmlPropertyPrivate >
 ~QQmlRefCounted ()

Detailed Description

Definition at line 40 of file qqmlproperty_p.h.

Member Enumeration Documentation

◆ BindingFlag

Enumerator
None 
DontEnable 
OverrideSticky 

Definition at line 112 of file qqmlproperty_p.h.

◆ InitFlag

enum class QQmlPropertyPrivate::InitFlag
strong
Enumerator
None 
AllowId 
AllowSignal 

Definition at line 43 of file qqmlproperty_p.h.

Constructor & Destructor Documentation

◆ QQmlPropertyPrivate()

QQmlPropertyPrivate::QQmlPropertyPrivate ( )
inline

Definition at line 62 of file qqmlproperty_p.h.

Member Function Documentation

◆ binding() [1/2]

QQmlAbstractBinding * QQmlPropertyPrivate::binding ( const QQmlProperty & that)
static

Returns the binding associated with this property, or 0 if no binding exists.

Definition at line 810 of file qqmlproperty.cpp.

◆ binding() [2/2]

QQmlAbstractBinding * QQmlPropertyPrivate::binding ( QObject * object,
QQmlPropertyIndex index )
static

Definition at line 911 of file qqmlproperty.cpp.

◆ connect()

bool QQmlPropertyPrivate::connect ( const QObject * sender,
int signal_index,
const QObject * receiver,
int method_index,
int type = 0,
int * types = nullptr )
static

Connect sender signal_index to receiver method_index with the specified type and types.

This behaves identically to QMetaObject::connect() except that it connects any lazy "proxy" signal connections set up by QML.

It is possible that this logic should be moved to QMetaObject::connect().

Definition at line 2248 of file qqmlproperty.cpp.

◆ create()

QQmlProperty QQmlPropertyPrivate::create ( QObject * target,
const QString & propertyName,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyPrivate::InitFlags flags )
static

Definition at line 198 of file qqmlproperty.cpp.

◆ effectiveContext()

QQmlRefPointer< QQmlContextData > QQmlPropertyPrivate::effectiveContext ( ) const

Definition at line 221 of file qqmlproperty.cpp.

◆ encodedIndex() [1/2]

QQmlPropertyIndex QQmlPropertyPrivate::encodedIndex ( ) const
inline

Definition at line 64 of file qqmlproperty_p.h.

◆ encodedIndex() [2/2]

QQmlPropertyIndex QQmlPropertyPrivate::encodedIndex ( const QQmlPropertyData & core,
const QQmlPropertyData & valueTypeData )
inlinestatic

Definition at line 66 of file qqmlproperty_p.h.

◆ findAliasTarget() [1/2]

void QQmlPropertyPrivate::findAliasTarget ( QObject * object,
QQmlPropertyIndex bindingIndex,
QObject ** targetObject,
QQmlPropertyIndex * targetBindingIndex )
static

Definition at line 940 of file qqmlproperty.cpp.

◆ findAliasTarget() [2/2]

QQmlPropertyPrivate::ResolvedAlias QQmlPropertyPrivate::findAliasTarget ( QObject * baseObject,
QQmlPropertyIndex baseIndex )
static

Given an alias property specified by baseObject and baseIndex, this function computes the alias target.

Definition at line 976 of file qqmlproperty.cpp.

◆ findPropertyByName()

QMetaProperty QQmlPropertyPrivate::findPropertyByName ( const QMetaObject * mo,
const QByteArray & name )
static

Return the property corresponding to name.

Definition at line 2211 of file qqmlproperty.cpp.

◆ findSignalByName()

QMetaMethod QQmlPropertyPrivate::findSignalByName ( const QMetaObject * mo,
const QByteArray & name )
static

Return the signal corresponding to name.

Definition at line 2183 of file qqmlproperty.cpp.

◆ flushSignal()

void QQmlPropertyPrivate::flushSignal ( const QObject * sender,
int signal_index )
static

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

Definition at line 2263 of file qqmlproperty.cpp.

◆ get()

QQmlPropertyPrivate * QQmlPropertyPrivate::get ( const QQmlProperty & p)
inlinestatic

Definition at line 132 of file qqmlproperty_p.h.

◆ initDefault()

void QQmlPropertyPrivate::initDefault ( QObject * obj)

Initialize from the default property of obj.

Definition at line 137 of file qqmlproperty.cpp.

◆ initProperty()

void QQmlPropertyPrivate::initProperty ( QObject * obj,
const QString & name,
InitFlags flags = InitFlag::None )

Definition at line 232 of file qqmlproperty.cpp.

◆ isValueType()

bool QQmlPropertyPrivate::isValueType ( ) const

Definition at line 599 of file qqmlproperty.cpp.

◆ propertyIndex()

QQmlPropertyIndex QQmlPropertyPrivate::propertyIndex ( const QQmlProperty & that)
static

Definition at line 2156 of file qqmlproperty.cpp.

◆ propertyType()

QMetaType QQmlPropertyPrivate::propertyType ( ) const

Definition at line 604 of file qqmlproperty.cpp.

◆ propertyTypeCategory()

QQmlProperty::PropertyTypeCategory QQmlPropertyPrivate::propertyTypeCategory ( ) const

Definition at line 521 of file qqmlproperty.cpp.

◆ Q_DECLARE_FLAGS()

QQmlPropertyPrivate::Q_DECLARE_FLAGS ( InitFlags ,
InitFlag  )

◆ rawMetaObjectForType()

QQmlMetaObject QQmlPropertyPrivate::rawMetaObjectForType ( QMetaType metaType)
static

Definition at line 1974 of file qqmlproperty.cpp.

◆ readValueProperty()

QVariant QQmlPropertyPrivate::readValueProperty ( )

Definition at line 1152 of file qqmlproperty.cpp.

◆ removeBinding() [1/3]

bool QQmlPropertyPrivate::removeBinding ( const QQmlProperty & that,
BindingFlags flags = None )
static

◆ removeBinding() [2/3]

bool QQmlPropertyPrivate::removeBinding ( QObject * o,
QQmlPropertyIndex index,
BindingFlags flags = None )
static

◆ removeBinding() [3/3]

bool QQmlPropertyPrivate::removeBinding ( QQmlAbstractBinding * b,
QQmlPropertyPrivate::BindingFlags flags = None )
static

Definition at line 886 of file qqmlproperty.cpp.

◆ reset()

bool QQmlPropertyPrivate::reset ( QObject * object,
const QQmlPropertyData & property,
QQmlPropertyData::WriteFlags flags = {} )
static

Definition at line 1965 of file qqmlproperty.cpp.

◆ resetValueProperty()

bool QQmlPropertyPrivate::resetValueProperty ( QObject * object,
const QQmlPropertyData & core,
const QQmlPropertyData & valueTypeData,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData::WriteFlags flags = {} )
static

Definition at line 1348 of file qqmlproperty.cpp.

◆ resolveUrlsOnAssignment()

bool QQmlPropertyPrivate::resolveUrlsOnAssignment ( )
static

Definition at line 216 of file qqmlproperty.cpp.

◆ restore()

QQmlProperty QQmlPropertyPrivate::restore ( QObject * object,
const QQmlPropertyData & data,
const QQmlPropertyData * valueTypeData,
const QQmlRefPointer< QQmlContextData > & ctxt )
static

Definition at line 2162 of file qqmlproperty.cpp.

◆ setBinding() [1/2]

void QQmlPropertyPrivate::setBinding ( const QQmlProperty & that,
QQmlAbstractBinding * newBinding )
static

Set the binding associated with this property to newBinding.

Returns the existing binding (if any), otherwise 0.

newBinding will be enabled, and the returned binding (if any) will be disabled.

Ownership of newBinding transfers to QML. Ownership of the return value is assumed by the caller.

Definition at line 830 of file qqmlproperty.cpp.

◆ setBinding() [2/2]

void QQmlPropertyPrivate::setBinding ( QQmlAbstractBinding * binding,
BindingFlags flags = None,
QQmlPropertyData::WriteFlags writeFlags = QQmlPropertyData::DontRemoveBinding )
static

Definition at line 985 of file qqmlproperty.cpp.

◆ setSignalExpression()

void QQmlPropertyPrivate::setSignalExpression ( const QQmlProperty & that,
QQmlBoundSignalExpression * expr )
static

Set the signal expression associated with this signal property to expr.

A reference to expr will be added by QML.

Definition at line 1040 of file qqmlproperty.cpp.

◆ signalExpression()

QQmlBoundSignalExpression * QQmlPropertyPrivate::signalExpression ( const QQmlProperty & that)
static

Returns the expression associated with this signal property, or 0 if no signal expression exists.

Definition at line 1014 of file qqmlproperty.cpp.

◆ signalIndex()

int QQmlPropertyPrivate::signalIndex ( ) const

Returns the index of this property's signal, in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex().

Definition at line 474 of file qqmlproperty.cpp.

◆ takeSignalExpression()

void QQmlPropertyPrivate::takeSignalExpression ( const QQmlProperty & that,
QQmlBoundSignalExpression * expr )
static

Set the signal expression associated with this signal property to expr.

Ownership of expr transfers to QML.

Definition at line 1051 of file qqmlproperty.cpp.

◆ type()

QQmlProperty::Type QQmlPropertyPrivate::type ( ) const

Definition at line 616 of file qqmlproperty.cpp.

◆ urlSequence() [1/2]

QList< QUrl > QQmlPropertyPrivate::urlSequence ( const QVariant & value)
static

Definition at line 1214 of file qqmlproperty.cpp.

◆ urlSequence() [2/2]

QList< QUrl > QQmlPropertyPrivate::urlSequence ( const QVariant & value,
const QQmlRefPointer< QQmlContextData > & ctxt )
static

Definition at line 1237 of file qqmlproperty.cpp.

◆ write() [1/2]

bool QQmlPropertyPrivate::write ( const QQmlProperty & that,
const QVariant & value,
QQmlPropertyData::WriteFlags flags )
static

Definition at line 2067 of file qqmlproperty.cpp.

◆ write() [2/2]

bool QQmlPropertyPrivate::write ( QObject * object,
const QQmlPropertyData & property,
const QVariant & value,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData::WriteFlags flags = {} )
static

Definition at line 1763 of file qqmlproperty.cpp.

◆ writeEnumProperty()

bool QQmlPropertyPrivate::writeEnumProperty ( const QMetaProperty & prop,
int idx,
QObject * object,
const QVariant & value,
int flags )
static

Definition at line 1249 of file qqmlproperty.cpp.

◆ writeValueProperty() [1/2]

bool QQmlPropertyPrivate::writeValueProperty ( const QVariant & value,
QQmlPropertyData::WriteFlags flags )

Definition at line 1281 of file qqmlproperty.cpp.

◆ writeValueProperty() [2/2]

bool QQmlPropertyPrivate::writeValueProperty ( QObject * object,
const QQmlPropertyData & core,
const QQmlPropertyData & valueTypeData,
const QVariant & value,
const QQmlRefPointer< QQmlContextData > & context,
QQmlPropertyData::WriteFlags flags = {} )
static

Definition at line 1331 of file qqmlproperty.cpp.

Member Data Documentation

◆ context

◆ core

QQmlPropertyData QQmlPropertyPrivate::core

Definition at line 54 of file qqmlproperty_p.h.

◆ engine

QPointer<QQmlEngine> QQmlPropertyPrivate::engine

Definition at line 51 of file qqmlproperty_p.h.

◆ nameCache

QString QQmlPropertyPrivate::nameCache

Definition at line 57 of file qqmlproperty_p.h.

◆ object

QPointer<QObject> QQmlPropertyPrivate::object

Definition at line 52 of file qqmlproperty_p.h.

◆ valueTypeData

QQmlPropertyData QQmlPropertyPrivate::valueTypeData

Definition at line 55 of file qqmlproperty_p.h.


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