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

\inmodule QtQml More...

#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 class  ListCopyResult { Copied , WasEqual , TypeMismatch }
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 ListCopyResult convertToQQmlListProperty (QQmlListProperty< QObject > *listProperty, QMetaType actualListType, const QVariant &value)
static QVariant convertToWriteTargetType (const QVariant &value, QMetaType targetMetaType)
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

\inmodule QtQml

Definition at line 41 of file qqmlproperty_p.h.

Member Enumeration Documentation

◆ BindingFlag

Enumerator
None 
DontEnable 
OverrideSticky 

Definition at line 133 of file qqmlproperty_p.h.

◆ InitFlag

enum class QQmlPropertyPrivate::InitFlag
strong
Enumerator
None 
AllowId 
AllowSignal 

Definition at line 44 of file qqmlproperty_p.h.

◆ ListCopyResult

Enumerator
Copied 
WasEqual 
TypeMismatch 

Definition at line 52 of file qqmlproperty_p.h.

Constructor & Destructor Documentation

◆ QQmlPropertyPrivate()

QQmlPropertyPrivate::QQmlPropertyPrivate ( )
inline

Definition at line 71 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 817 of file qqmlproperty.cpp.

◆ binding() [2/2]

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

Definition at line 918 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 2304 of file qqmlproperty.cpp.

◆ convertToQQmlListProperty()

QQmlPropertyPrivate::ListCopyResult QQmlPropertyPrivate::convertToQQmlListProperty ( QQmlListProperty< QObject > * listProperty,
QMetaType actualListType,
const QVariant & value )
static

Attempts to convert value to a QQmlListProperty. The existing listProperty will be modified (so use a temporary one if that is not desired). listProperty is passed as a QQmlListProperty<QObject>, but might actually be a list property of a more specific type. The actual type of the list property is given by actualListType.

Definition at line 1644 of file qqmlproperty.cpp.

◆ convertToWriteTargetType()

QVariant QQmlPropertyPrivate::convertToWriteTargetType ( const QVariant & value,
QMetaType targetMetaType )
static

Definition at line 1796 of file qqmlproperty.cpp.

◆ create()

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

Definition at line 205 of file qqmlproperty.cpp.

◆ effectiveContext()

QQmlRefPointer< QQmlContextData > QQmlPropertyPrivate::effectiveContext ( ) const

Definition at line 228 of file qqmlproperty.cpp.

◆ encodedIndex() [1/2]

QQmlPropertyIndex QQmlPropertyPrivate::encodedIndex ( ) const
inline

Definition at line 73 of file qqmlproperty_p.h.

◆ encodedIndex() [2/2]

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

Definition at line 75 of file qqmlproperty_p.h.

◆ findAliasTarget() [1/2]

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

Definition at line 947 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 983 of file qqmlproperty.cpp.

◆ findPropertyByName()

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

Return the property corresponding to name.

Definition at line 2267 of file qqmlproperty.cpp.

◆ findSignalByName()

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

Return the signal corresponding to name.

Definition at line 2239 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 2319 of file qqmlproperty.cpp.

◆ get()

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

Definition at line 153 of file qqmlproperty_p.h.

◆ initDefault()

void QQmlPropertyPrivate::initDefault ( QObject * obj)

Initialize from the default property of obj.

Definition at line 144 of file qqmlproperty.cpp.

◆ initProperty()

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

Definition at line 239 of file qqmlproperty.cpp.

◆ isValueType()

bool QQmlPropertyPrivate::isValueType ( ) const

Definition at line 606 of file qqmlproperty.cpp.

◆ propertyIndex()

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

Definition at line 2212 of file qqmlproperty.cpp.

◆ propertyType()

QMetaType QQmlPropertyPrivate::propertyType ( ) const

Definition at line 611 of file qqmlproperty.cpp.

◆ propertyTypeCategory()

QQmlProperty::PropertyTypeCategory QQmlPropertyPrivate::propertyTypeCategory ( ) const

Definition at line 528 of file qqmlproperty.cpp.

◆ Q_DECLARE_FLAGS()

QQmlPropertyPrivate::Q_DECLARE_FLAGS ( InitFlags ,
InitFlag  )

◆ rawMetaObjectForType()

QQmlMetaObject QQmlPropertyPrivate::rawMetaObjectForType ( QMetaType metaType)
static

Definition at line 2030 of file qqmlproperty.cpp.

◆ readValueProperty()

QVariant QQmlPropertyPrivate::readValueProperty ( )

Definition at line 1159 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 893 of file qqmlproperty.cpp.

◆ reset()

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

Definition at line 2021 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 1355 of file qqmlproperty.cpp.

◆ resolveUrlsOnAssignment()

bool QQmlPropertyPrivate::resolveUrlsOnAssignment ( )
static

Definition at line 223 of file qqmlproperty.cpp.

◆ restore()

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

Definition at line 2218 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 837 of file qqmlproperty.cpp.

◆ setBinding() [2/2]

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

Definition at line 992 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 1047 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 1021 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 481 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 1058 of file qqmlproperty.cpp.

◆ type()

QQmlProperty::Type QQmlPropertyPrivate::type ( ) const

Definition at line 623 of file qqmlproperty.cpp.

◆ urlSequence() [1/2]

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

Definition at line 1221 of file qqmlproperty.cpp.

◆ urlSequence() [2/2]

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

Definition at line 1244 of file qqmlproperty.cpp.

◆ write() [1/2]

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

Definition at line 2123 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 1900 of file qqmlproperty.cpp.

◆ writeEnumProperty()

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

Definition at line 1256 of file qqmlproperty.cpp.

◆ writeValueProperty() [1/2]

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

Definition at line 1288 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 1338 of file qqmlproperty.cpp.

Member Data Documentation

◆ context

◆ core

QQmlPropertyData QQmlPropertyPrivate::core

Definition at line 63 of file qqmlproperty_p.h.

◆ engine

QPointer<QQmlEngine> QQmlPropertyPrivate::engine

Definition at line 60 of file qqmlproperty_p.h.

◆ nameCache

QString QQmlPropertyPrivate::nameCache

Definition at line 66 of file qqmlproperty_p.h.

◆ object

QPointer<QObject> QQmlPropertyPrivate::object

Definition at line 61 of file qqmlproperty_p.h.

◆ valueTypeData

QQmlPropertyData QQmlPropertyPrivate::valueTypeData

Definition at line 64 of file qqmlproperty_p.h.


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