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

The UntypedProxyProperty class is a property used in Behavior to handle bindable properties. More...

+ Inheritance diagram for UntypedProxyProperty:
+ Collaboration diagram for UntypedProxyProperty:

Public Member Functions

 UntypedProxyProperty (QUntypedBindable bindable, QQuickBehaviorPrivate *behavior)
 
QUntypedBindable getBindable ()
 
QMetaType type () const
 
QVariant value () const
 

Static Public Member Functions

static void getter (const QUntypedPropertyData *d, void *value)
 
static void setter (QUntypedPropertyData *d, const void *value)
 
static QUntypedPropertyBinding bindingGetter (const QUntypedPropertyData *d)
 
static QUntypedPropertyBinding bindingSetter (QUntypedPropertyData *d, const QUntypedPropertyBinding &binding)
 
static QUntypedPropertyBinding makeBinding (const QUntypedPropertyData *d, const QPropertyBindingSourceLocation &location)
 
static void setObserver (const QUntypedPropertyData *d, QPropertyObserver *observer)
 

Detailed Description

The UntypedProxyProperty class is a property used in Behavior to handle bindable properties.

Whenever a bindable property with a Behavior gets a request for its bindable interface, we instead return the bindable interface of the UntypedProxyProperty. This causes all reads and writes to be intercepted to use m_storage instead; moreover, any installed binding will also use m_storage as the property data for the binding.

The BehaviorPrivate acts as an observer, listening to changes of the proxy property. If those occur, QQuickBehavior::write is called with the new value, which will then adjust the actual property (playing animations if necessary).

Warning
The interception mechanism works only via the metaobject system, just like it is the case with non-binadble properties and writes. Bypassing the metaobject system can thus lead to inconsistent results; it is however currently safe, as we do not publically expose the classes, and the code in Quick plays nicely.

Definition at line 39 of file qquickbehavior.cpp.

Constructor & Destructor Documentation

◆ UntypedProxyProperty()

UntypedProxyProperty::UntypedProxyProperty ( QUntypedBindable bindable,
QQuickBehaviorPrivate * behavior )

Definition at line 152 of file qquickbehavior.cpp.

Member Function Documentation

◆ bindingGetter()

static QUntypedPropertyBinding UntypedProxyProperty::bindingGetter ( const QUntypedPropertyData * d)
inlinestatic

Definition at line 67 of file qquickbehavior.cpp.

References d.

◆ bindingSetter()

static QUntypedPropertyBinding UntypedProxyProperty::bindingSetter ( QUntypedPropertyData * d,
const QUntypedPropertyBinding & binding )
inlinestatic

Definition at line 73 of file qquickbehavior.cpp.

References d, QPropertyBindingPrivate::get(), type(), and QUntypedPropertyBinding::valueMetaType().

Referenced by QQuickBehavior::setTarget().

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

◆ getBindable()

QUntypedBindable UntypedProxyProperty::getBindable ( )

Definition at line 127 of file qquickbehavior.cpp.

◆ getter()

static void UntypedProxyProperty::getter ( const QUntypedPropertyData * d,
void * value )
inlinestatic

Definition at line 46 of file qquickbehavior.cpp.

References QMetaType::construct(), d, and QtPrivate::QBindableInterface::MetaTypeAccessorFlag.

+ Here is the call graph for this function:

◆ makeBinding()

static QUntypedPropertyBinding UntypedProxyProperty::makeBinding ( const QUntypedPropertyData * d,
const QPropertyBindingSourceLocation & location )
inlinestatic

Definition at line 89 of file qquickbehavior.cpp.

References d, and QtPrivate::QBindableInterface::makeBinding.

◆ setObserver()

static void UntypedProxyProperty::setObserver ( const QUntypedPropertyData * d,
QPropertyObserver * observer )
inlinestatic

Definition at line 96 of file qquickbehavior.cpp.

References d, and QtPrivate::QBindableInterface::setObserver.

◆ setter()

static void UntypedProxyProperty::setter ( QUntypedPropertyData * d,
const void * value )
inlinestatic

Definition at line 60 of file qquickbehavior.cpp.

References QMetaType::construct(), d, type(), and value().

+ Here is the call graph for this function:

◆ type()

QMetaType UntypedProxyProperty::type ( ) const
inline

Definition at line 107 of file qquickbehavior.cpp.

References QVariant::metaType().

Referenced by bindingSetter(), and setter().

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

◆ value()

QVariant UntypedProxyProperty::value ( ) const
inline

Definition at line 108 of file qquickbehavior.cpp.

Referenced by setter().

+ Here is the caller graph for this function:

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