QtBase
v6.3.1
|
QBindable is a wrapper class around binding-enabled properties. It allows type-safe operations while abstracting the differences between the various property classes away. \inherits QUntypedBindable. More...
#include <qproperty.h>
Friends | |
template<typename U > | |
class | QPropertyAlias |
Additional Inherited Members | |
Protected Member Functions inherited from QUntypedBindable | |
constexpr | QUntypedBindable (QUntypedPropertyData *d, const QtPrivate::QBindableInterface *i) |
Protected Attributes inherited from QUntypedBindable | |
QUntypedPropertyData * | data = nullptr |
const QtPrivate::QBindableInterface * | iface = nullptr |
QBindable is a wrapper class around binding-enabled properties. It allows type-safe operations while abstracting the differences between the various property classes away. \inherits QUntypedBindable.
\inmodule QtCore
QBindable<T> helps to integrate Qt's traditional Q_PROPERTY with \l {Qt Bindable Properties}{binding-enabled} properties. If a property is backed by a QProperty, QObjectBindableProperty or QObjectComputedProperty, you can add BINDABLE
bindablePropertyName to the Q_PROPERTY declaration, where bindablePropertyName is a function returning an instance of QBindable constructed from the QProperty. The returned QBindable allows users of the property to set and query bindings of the property, without having to know the exact kind of binding-enabled property used.
Definition at line 752 of file qproperty.h.
|
inlineexplicit |
|
inline |
Returns the currently set binding of the underlying property. If the property does not have a binding, the returned QPropertyBinding<T>
will be invalid.
Definition at line 773 of file qproperty.h.
|
inline |
Constructs a binding evaluating to the underlying property's value, using a specified source location.
Definition at line 769 of file qproperty.h.
|
constexprdefault |
Default-constructs a QUntypedBindable. It is in an invalid state.
|
inline |
Constructs a QUntypedBindable from the property property. If Property is const, the QUntypedBindable will be read only. If property is null, the QUntypedBindable will be invalid.
Definition at line 636 of file qproperty.h.
|
inlineconstexpr |
Definition at line 629 of file qproperty.h.
|
inline |
Sets the underlying property's binding to binding. Does nothing if the QBindable is read-only or invalid.
Definition at line 784 of file qproperty.h.
|
inline |
Sets the underlying property's binding to binding. This does not have any effect if the QUntypedBindable is read-only, null or if binding's type does match the underlying property's type.
true
when the binding was successfully set.!
Definition at line 710 of file qproperty.h.
|
inline |
|
inline |
Sets the underlying property's value to value. This removes any currenltly set binding from it. This function has no effect if the QBindable is read-only or invalid.
Definition at line 821 of file qproperty.h.
|
inline |
Removes the currently set binding of the underlying property and returns it. If the property does not have a binding, the returned QPropertyBinding<T>
will be invalid.
Definition at line 778 of file qproperty.h.
Returns the underlying property's current value. If the QBindable is invalid, a default constructed T
is returned.
Definition at line 811 of file qproperty.h.
Definition at line 755 of file qproperty.h.