QPropertyData Class

template <typename T> class QPropertyData

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

Header: #include <QPropertyData>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0
Inherits: QUntypedPropertyData
Inherited By:

QObjectBindableProperty and QProperty

Public Types

Public Functions

QPropertyData(QPropertyData::rvalue_ref t)
QPropertyData(QPropertyData::parameter_type t)
void setValueBypassingBindings(QPropertyData::parameter_type v)
void setValueBypassingBindings(QPropertyData::rvalue_ref v)
QPropertyData::parameter_type valueBypassingBindings() const

Protected Variables

T val

Static Protected Members

const bool UseReferences

Detailed Description

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.

Member Type Documentation

[alias] QPropertyData::arrow_operator_result

[alias] QPropertyData::parameter_type

[alias] QPropertyData::rvalue_ref

[alias] QPropertyData::value_type

Member Function Documentation

QPropertyData::QPropertyData(QPropertyData::rvalue_ref t)

Default constructs an instance of QPropertyData.

QPropertyData::QPropertyData(QPropertyData::parameter_type t)

Default constructs an instance of QPropertyData.


Default constructs an instance of QPropertyData.


Destroys the instance of QPropertyData.

void QPropertyData::setValueBypassingBindings(QPropertyData::parameter_type v)

Sets the data value stored in this property to v.

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

See also valueBypassingBindings().

void QPropertyData::setValueBypassingBindings(QPropertyData::rvalue_ref v)

This is an overloaded function.

Sets the data value stored in this property to v.

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

QPropertyData::parameter_type QPropertyData::valueBypassingBindings() const

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.

See also setValueBypassingBindings().

Member Variable Documentation

const bool QPropertyData::UseReferences

T QPropertyData::val

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.