An example of how to create a KDBindings::Property and use its valueChanged() KDBindings::Signal to receive notifications whenever the value of the KDBindigns::Property changes.
/* This file is part of KDBindings. SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> Author: Sean Harmer <sean.harmer@kdab.com> SPDX-License-Identifier: MIT Contact KDAB at <info@kdab.com> for commercial licensing options.*/#include<kdbindings/property.h>#include<iostream>#include<string>usingnamespaceKDBindings;classWidget{public:Widget(std::stringconst&name):value(0),m_name(name){}Property<int>value;private:std::stringm_name;};intmain(){Widgetw("A cool widget");w.value.valueChanged().connect([](intnewValue){std::cout<<"The new value is "<<newValue<<std::endl;});w.value=42;w.value=69;std::cout<<"Property value is "<<w.value<<std::endl;return0;}