KDBindings API Documentation  1.0.95
Properties

Properties are values that can notify observers of changes. They can therefore be used as values in data bindings.

Unlike Qts Properties, KDBindings Properties don't require a Meta Object Compiler and are available in pure C++17. They can even be used outside of classes as free values.

Declaring Properties

Properties can be declared for most types by creating a KDBindings::Property<T> instance.

The property instance will then emit signals every time the properties value changes, the property is moved or destructed.

Minimal example: declaring properties

#include <kdbindings/property.h>
using namespace KDBindings;
Property<std::string> myProperty;
myProperty.valueChanged().connect([](const std::string& value) {
std::cout << value << std::endl;
});
myProperty = "Hello World!";

Expected output:

Hello World!

For more information and examples see the KDBindings::Property documentation.


© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDBindings
Reactive programming & data binding in C++
https://github.com/KDAB/KDBindings/
Generated by doxygen 1.9.1