QtBase
v6.3.1
|
#include <qproperty.h>
Additional Inherited Members | |
Public Types inherited from QPropertyObserverBase | |
enum | ObserverTag { ObserverNotifiesBinding , ObserverNotifiesChangeHandler , ObserverIsPlaceholder , ObserverIsAlias } |
Protected Types inherited from QPropertyObserverBase | |
using | ChangeHandler = void(*)(QPropertyObserver *, QUntypedPropertyData *) |
Protected Member Functions inherited from QPropertyObserver | |
QPropertyObserver (ChangeHandler changeHandler) | |
QPropertyObserver (QUntypedPropertyData *aliasedPropertyPtr) | |
QUntypedPropertyData * | aliasedProperty () const |
\inmodule QtCore
Definition at line 829 of file qproperty.h.
|
inline |
Constructs a property alias for the given property.
Definition at line 835 of file qproperty.h.
|
inline |
|
inline |
Constructs a property alias for the property aliased by alias.
Definition at line 852 of file qproperty.h.
|
inline |
|
inline |
Subscribes the given functor f as a callback that is called whenever the value of the aliased property changes.
The callback f is expected to be a type that has a plain call operator () without any parameters. This means that you can provide a C++ lambda expression, a std::function or even a custom struct with a call operator.
The returned property change handler object keeps track of the subscription. When it goes out of scope, the callback is unsubscribed.
This method is in some cases easier to use than onValueChanged(), as the returned object is not a template. It can therefore more easily be stored, e.g. as a member in a class.
Definition at line 941 of file qproperty.h.
|
inline |
Returns the binding expression that is associated with the aliased property. A default constructed QPropertyBinding<T> will be returned if no such association exists.
Definition at line 918 of file qproperty.h.
|
inline |
Returns true if the aliased property is associated with a binding; false otherwise.
Definition at line 913 of file qproperty.h.
|
inline |
Returns true if the aliased property still exists; false otherwise.
If the aliased property doesn't exist, all other method calls are ignored.
Definition at line 946 of file qproperty.h.
|
inline |
Registers the given functor f as a callback that shall be called whenever the value of the aliased property changes. On each value change, the handler is either called immediately, or deferred, depending on the context.
The callback f is expected to be a type that has a plain call operator () without any parameters. This means that you can provide a C++ lambda expression, a std::function or even a custom struct with a call operator.
The returned property change handler object keeps track of the registration. When it goes out of scope, the callback is de-registered.
Definition at line 929 of file qproperty.h.
|
inline |
Returns the value of the aliased property. This may evaluate a binding expression that is tied to the property, before returning the value.
Definition at line 876 of file qproperty.h.
|
inline |
Assigns newValue to the aliased property and returns a reference to this QPropertyAlias.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Assigns newValue to the aliased property and returns a reference to this QPropertyAlias.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Associates the value of the aliased property with the provided newBinding expression and returns a reference to this alias. The first time the property value is read, either from the property itself or from any alias, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
Definition at line 884 of file qproperty.h.
|
inline |
Associates the value of the aliased property with the provided newBinding expression and returns any previous binding the associated with the aliased property. The first time the property value is read, either from the property itself or from any alias, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
Returns any previous binding associated with the property, or a default-constructed QPropertyBinding<T>.
Definition at line 890 of file qproperty.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Associates the value of the aliased property with the provided newBinding expression. The first time the property value is read, either from the property itself or from any alias, the binding is evaluated. Whenever a dependency of the binding changes, the binding will be re-evaluated the next time the value of this property is read.
Returns true if the type of this property is the same as the type the binding function returns; false otherwise.
Definition at line 895 of file qproperty.h.
|
inline |
|
inline |
Assigns newValue to the aliased property and removes the property's associated binding, if present.
Definition at line 878 of file qproperty.h.
|
inline |
Subscribes the given functor f as a callback that is called immediately and whenever the value of the aliased property changes in the future. On each value change, the handler is either called immediately, or deferred, depending on the context.
The callback f is expected to be a type that has a plain call operator () without any parameters. This means that you can provide a C++ lambda expression, a std::function or even a custom struct with a call operator.
The returned property change handler object keeps track of the subscription. When it goes out of scope, the callback is unsubscribed.
Definition at line 935 of file qproperty.h.
|
inline |
Disassociates the binding expression from the aliased property and returns it. After calling this function, the value of the property will only change if you assign a new value to it, or when a new binding is set.
Definition at line 923 of file qproperty.h.
|
inline |
Returns the value of the aliased property. This may evaluate a binding expression that is tied to the property, before returning the value.
Definition at line 868 of file qproperty.h.