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
QPropertyData< T > Class Template Reference

\inmodule QtCore More...

#include <qproperty.h>

+ Inheritance diagram for QPropertyData< T >:
+ Collaboration diagram for QPropertyData< T >:

Public Types

using value_type = T
 
using parameter_type = std::conditional_t<UseReferences, const T &, T>
 
using rvalue_ref = typename std::conditional_t<UseReferences, T &&, DisableRValueRefs>
 
using arrow_operator_result
 

Public Member Functions

 QPropertyData ()=default
 
 QPropertyData (parameter_type t)
 
 QPropertyData (rvalue_ref t)
 
 ~QPropertyData ()=default
 
parameter_type valueBypassingBindings () const
 Returns the data stored in this property.
 
void setValueBypassingBindings (parameter_type v)
 Sets the data value stored in this property to v.
 
void setValueBypassingBindings (rvalue_ref v)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the data value stored in this property to v.
 

Protected Attributes

val = T()
 

Static Protected Attributes

static constexpr bool UseReferences = !(std::is_arithmetic_v<T> || std::is_enum_v<T> || std::is_pointer_v<T>)
 

Detailed Description

template<typename T>
class QPropertyData< T >

\inmodule QtCore

The QPropertyData class is a helper class for properties with automatic property bindings.

Since
6.0

QPropertyData<T> is a common base class for classes that can hold properties with automatic data bindings. It mainly wraps the stored data, and offers low level access to that data.

The low level access to the data provided by this class bypasses the binding mechanism, and should be used with care, as updates to the values will not get propagated to any bindings that depend on this property.

You should usually call value() and setValue() on QProperty<T> or QObjectBindableProperty<T>, not use the low level mechanisms provided in this class.

Definition at line 68 of file qproperty.h.

Member Typedef Documentation

◆ arrow_operator_result

template<typename T >
using QPropertyData< T >::arrow_operator_result
Initial value:
std::conditional_t<std::is_pointer_v<T>, const T &,
std::conditional_t<QTypeTraits::is_dereferenceable_v<T>, const T &, void>>

Definition at line 80 of file qproperty.h.

◆ parameter_type

template<typename T >
using QPropertyData< T >::parameter_type = std::conditional_t<UseReferences, const T &, T>

Definition at line 78 of file qproperty.h.

◆ rvalue_ref

template<typename T >
using QPropertyData< T >::rvalue_ref = typename std::conditional_t<UseReferences, T &&, DisableRValueRefs>

Definition at line 79 of file qproperty.h.

◆ value_type

template<typename T >
using QPropertyData< T >::value_type = T

Definition at line 77 of file qproperty.h.

Constructor & Destructor Documentation

◆ QPropertyData() [1/3]

template<typename T >
QPropertyData< T >::QPropertyData ( )
default

◆ QPropertyData() [2/3]

template<typename T >
QPropertyData< T >::QPropertyData ( parameter_type t)
inline

Definition at line 84 of file qproperty.h.

◆ QPropertyData() [3/3]

template<typename T >
QPropertyData< T >::QPropertyData ( rvalue_ref t)
inline

Definition at line 85 of file qproperty.h.

◆ ~QPropertyData()

template<typename T >
QPropertyData< T >::~QPropertyData ( )
default

Member Function Documentation

◆ setValueBypassingBindings() [1/2]

template<typename T >
template< typename T > void QPropertyData< T >::setValueBypassingBindings ( parameter_type v)
inline

Sets the data value stored in this property to v.

Note
Using this method will bypass any potential binding registered for this property.

Definition at line 89 of file qproperty.h.

◆ setValueBypassingBindings() [2/2]

template<typename T >
template< typename T > void QPropertyData< T >::setValueBypassingBindings ( rvalue_ref v)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the data value stored in this property to v.

Note
Using this method will bypass any potential binding registered for this property.

Definition at line 90 of file qproperty.h.

◆ valueBypassingBindings()

template<typename T >
template< typename T > QPropertyData< T >::parameter_type QPropertyData< T >::valueBypassingBindings ( ) const
inline

Returns the data stored in this property.

Note
As this will bypass any binding evaluation it might return an outdated value if a binding is set on this property. Using this method will also not register the property access with any currently executing binding.

Definition at line 88 of file qproperty.h.

References QPropertyData< T >::val.

Member Data Documentation

◆ UseReferences

template<typename T >
constexpr bool QPropertyData< T >::UseReferences = !(std::is_arithmetic_v<T> || std::is_enum_v<T> || std::is_pointer_v<T>)
staticconstexprprotected

Definition at line 75 of file qproperty.h.

◆ val


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