Qx v0.6
Qt Extensions Library
Loading...
Searching...
No Matches
Qx::PropertyBinding< T > Class Template Reference

The PropertyBinding class acts as a functor for properties with automatic property bindings. More...

#include <qx/core/qx-property.h>

Public Member Functions

 PropertyBinding ()=default
 
template<std::invocable Functor>
 PropertyBinding (Functor &&f)
 
bool isNull () const
 
 operator bool () const
 
operator() () const
 

Detailed Description

template<typename T>
class Qx::PropertyBinding< T >

PropertyBinding encapsulates a binding function to be used with properties in order to enable automatic updates of that property when its dependencies change. This class is often not used directly, and instead a binding is generally created directly within a property via Property::setBinding(), though it is possible to pre-create bindings, as well as move them between properties.

Constructor & Destructor Documentation

◆ PropertyBinding() [1/2]

template<typename T >
Qx::PropertyBinding< T >::PropertyBinding ( )
default

Constructs a null property binding.

◆ PropertyBinding() [2/2]

template<typename T >
template<std::invocable Functor>
Qx::PropertyBinding< T >::PropertyBinding ( Functor && f)
inline

Constructs a property binding from functor f.

Member Function Documentation

◆ isNull()

template<typename T >
bool Qx::PropertyBinding< T >::isNull ( ) const
inline

Returns true if the binding is null; otherwise, returns false.

A property binding is null if it contains no callable function target (i.e. is default constructed).

See also
operator bool().

◆ operator bool()

template<typename T >
Qx::PropertyBinding< T >::operator bool ( ) const
inlineexplicit

Same as isNull().

◆ operator()()

template<typename T >
T Qx::PropertyBinding< T >::operator() ( ) const
inline

Invokes the contained callable function target, if present.


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