KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
KDBindings Namespace Reference

The main namespace of the KDBindings library. More...

Namespaces

namespace  Private
 A namespace containing parts of KDBindings that are not part of the public API.
 

Classes

class  Binding
 A combination of a root Node with an evaluator. More...
 
class  Binding< T, ImmediateBindingEvaluator >
 Provides a convenience for old-school, immediate mode Bindings. More...
 
class  BindingEvaluator
 A BindingEvaluator provides a mechanism to control the exact time when a KDBindings::Binding is reevaluated. More...
 
class  ConnectionBlocker
 A ConnectionBlocker is a convenient RAII-style mechanism for temporarily blocking a connection. More...
 
class  ConnectionHandle
 A ConnectionHandle represents the connection of a Signal to a slot (i.e. a function that is called when the Signal is emitted). More...
 
struct  equal_to
 An instance of the KDBindings::equal_to struct is used to decide whether two values of type T are equal in the context of data binding. More...
 
class  ImmediateBindingEvaluator
 
struct  node_abs
 An example struct that is used with a call to KDBINDINGS_DECLARE_FUNCTION to declare all overloads of std::abs as usable in data binding. More...
 
class  Property
 A property represents a value that can be part of or the result of data binding. More...
 
class  PropertyDestroyedError
 A PropertyDestroyedError is thrown whenever a binding is evaluated that references a property that no longer exists. More...
 
class  PropertyUpdater
 A PropertyUpdater defines the interface used to update a Property, e.g. from a binding expression. More...
 
struct  ReadOnlyProperty
 
class  ScopedConnection
 A ScopedConnection is a RAII-style way to make sure a Connection is disconnected. More...
 
class  Signal
 A Signal provides a mechanism for communication between objects. More...
 

Functions

template<typename EvaluatorT , typename Func , typename... Args, typename = std::enable_if_t<sizeof...(Args) != 0>, typename ResultType = Private::operator_node_result_t<Func, Args...>>
std::unique_ptr< Binding< ResultType, EvaluatorT > > makeBinding (EvaluatorT &evaluator, Func &&func, Args &&...args)
 Helper function to create a Binding from a function and its arguments.
 
template<typename T , typename EvaluatorT >
std::unique_ptr< Binding< T, EvaluatorT > > makeBinding (EvaluatorT &evaluator, Private::Node< T > &&rootNode)
 Helper function to create a Binding from a root Node.
 
template<typename T , typename EvaluatorT >
std::unique_ptr< Binding< T, EvaluatorT > > makeBinding (EvaluatorT &evaluator, Property< T > &property)
 Helper function to create a Binding from a Property.
 
template<typename Func , typename... Args, typename = std::enable_if_t<sizeof...(Args) != 0>, typename ResultType = Private::operator_node_result_t<Func, Args...>>
std::unique_ptr< Binding< ResultType, ImmediateBindingEvaluator > > makeBinding (Func &&func, Args &&...args)
 Helper function to create an immediate mode Binding from a function and its arguments.
 
template<typename T >
std::unique_ptr< Binding< T, ImmediateBindingEvaluator > > makeBinding (Private::Node< T > &&rootNode)
 Helper function to create an immediate mode Binding from a root Node.
 
template<typename T >
std::unique_ptr< Binding< T, ImmediateBindingEvaluator > > makeBinding (Property< T > &property)
 Helper function to create an immediate mode Binding from a Property.
 
template<typename... T>
auto makeBoundProperty (T &&...args)
 Helper function to create a Property with a Binding.
 
template<typename T >
std::ostream & operator<< (std::ostream &stream, Property< T > const &property)
 
template<typename T >
std::istream & operator>> (std::istream &stream, Property< T > &prop)
 

Detailed Description

The main namespace of the KDBindings library.

All public parts of KDBindings are members of this namespace.

Function Documentation

◆ makeBinding() [1/6]

template<typename EvaluatorT , typename Func , typename... Args, typename = std::enable_if_t<sizeof...(Args) != 0>, typename ResultType = Private::operator_node_result_t<Func, Args...>>
std::unique_ptr< Binding< ResultType, EvaluatorT > > KDBindings::makeBinding ( EvaluatorT &  evaluator,
Func &&  func,
Args &&...  args 
)
inline

Helper function to create a Binding from a function and its arguments.

Template Parameters
EvaluatorTThe type of the evaluator that is used to evaluate the Binding.
Parameters
evaluatorThe evaluator that is used to evaluate the Binding.
Template Parameters
FuncThe type of the function - may be any type that implements operator().
Parameters
funcThe function object.
Template Parameters
ArgsThe function argument types
Parameters
argsThe function arguments - Possible values include: Properties, Constants and Nodes They will be automatically unwrapped, i.e. a Property<T> will pass a value of type T to func.
Returns
std::unique_ptr<Binding<ReturnType, EvaluatorT>> where ReturnType is the type that results from evaluationg func with the given arguments. The Binding will be powered by the new evaluator.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 163 of file binding.h.

References KDBindings::Private::makeNode().

◆ makeBinding() [2/6]

template<typename T , typename EvaluatorT >
std::unique_ptr< Binding< T, EvaluatorT > > KDBindings::makeBinding ( EvaluatorT &  evaluator,
Private::Node< T > &&  rootNode 
)
inline

Helper function to create a Binding from a root Node.

Template Parameters
TThe type of the value that the Binding expression evaluates to.
EvaluatorTThe type of the evaluator that is used to evaluate the Binding.
Parameters
evaluatorThe evaluator that is used to evaluate the Binding.
rootNodeRepresents the expression that will be evaluated by the Binding.
Returns
std::unique_ptr<Binding<T, EvaluatorT>> A new Binding that combines the rootNode with the evaluator.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 141 of file binding.h.

◆ makeBinding() [3/6]

template<typename T , typename EvaluatorT >
std::unique_ptr< Binding< T, EvaluatorT > > KDBindings::makeBinding ( EvaluatorT &  evaluator,
Property< T > &  property 
)
inline

Helper function to create a Binding from a Property.

Template Parameters
TThe type of the value that the Binding expression evaluates to.
EvaluatorTThe type of the evaluator that is used to evaluate the Binding.
Parameters
evaluatorThe evaluator that is used to evaluate the Binding.
propertyThe Property to create a Binding from.
Returns
std::unique_ptr<Binding<T, EvaluatorT>> A new Binding that is powered by the evaluator.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 123 of file binding.h.

References KDBindings::Private::makeNode().

Referenced by makeBoundProperty().

◆ makeBinding() [4/6]

template<typename Func , typename... Args, typename = std::enable_if_t<sizeof...(Args) != 0>, typename ResultType = Private::operator_node_result_t<Func, Args...>>
std::unique_ptr< Binding< ResultType, ImmediateBindingEvaluator > > KDBindings::makeBinding ( Func &&  func,
Args &&...  args 
)
inline

Helper function to create an immediate mode Binding from a function and its arguments.

Template Parameters
FuncThe type of the function - may be any type that implements operator().
Parameters
funcThe function object.
Template Parameters
ArgsThe function argument types
Parameters
argsThe function arguments - Possible values include: Properties, Constants and Nodes They will be automatically unwrapped, i.e. a Property<T> will pass a value of type T to func.
Returns
std::unique_ptr<Binding<ReturnType, ImmediateBindingEvaluator>> where ReturnType is the type that results from evaluationg func with the given arguments. The Binding will feature immediate evaluation.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 262 of file binding.h.

References KDBindings::Private::makeNode().

◆ makeBinding() [5/6]

template<typename T >
std::unique_ptr< Binding< T, ImmediateBindingEvaluator > > KDBindings::makeBinding ( Private::Node< T > &&  rootNode)
inline

Helper function to create an immediate mode Binding from a root Node.

Template Parameters
TThe type of the value that the Binding expression evaluates to.
Parameters
rootNodeRepresents the expression that will be evaluated by the Binding. Typically constructed from a unary/binary operator on a Property.
Returns
std::unique_ptr<Binding<<T, ImmediateBindingEvaluator>> An new Binding bound to a root Node with immediate evaluation.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 242 of file binding.h.

◆ makeBinding() [6/6]

template<typename T >
std::unique_ptr< Binding< T, ImmediateBindingEvaluator > > KDBindings::makeBinding ( Property< T > &  property)
inline

Helper function to create an immediate mode Binding from a Property.

Template Parameters
TThe type of the value that the Binding expression evaluates to.
Parameters
propertyThe Property to create a Binding from.
Returns
std::unique_ptr<Binding<T, ImmediateBindingEvaluator>> An new Binding bound to an existing Property with immediate evaluation.

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 225 of file binding.h.

References KDBindings::Private::makeNode().

◆ makeBoundProperty()

template<typename... T>
auto KDBindings::makeBoundProperty ( T &&...  args)
inline

Helper function to create a Property with a Binding.

This function can take:

  • Another Property.
  • A Node, typically created by combining Property instances using operators.
  • A function with arguments (Nodes, Constants or Properties) By default this will construct a Property with an immediate binding evaluation.

Alternatively a BindingEvaluator can be passed as the first argument to this function to control when evaluation takes place.

See the documentation for the various overloads of the free makeBinding function for a detailed description of which arguments can be used in which order.

Examples:

Returns
Property A new Property that is bound to the inputs

Note: For the difference between makeBinding and makeBoundProperty, see the "Reassigning a Binding" section in the Getting Started guide.

Definition at line 292 of file binding.h.

References makeBinding().

◆ operator<<()

template<typename T >
std::ostream & KDBindings::operator<< ( std::ostream &  stream,
Property< T > const &  property 
)

Outputs the value of the Property onto an output stream.

Definition at line 394 of file property.h.

◆ operator>>()

template<typename T >
std::istream & KDBindings::operator>> ( std::istream &  stream,
Property< T > &  prop 
)

Reads a value of type T from the input stream and assigns it to the Property using set().

Definition at line 405 of file property.h.

References KDBindings::Property< T >::set().


© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8