diff --git a/examples/corelib/bindableproperties/bindablesubscription/main.cpp b/examples/corelib/bindableproperties/bindablesubscription/main.cpp index 6cf73c13379..fb247836863 100644 --- a/examples/corelib/bindableproperties/bindablesubscription/main.cpp +++ b/examples/corelib/bindableproperties/bindablesubscription/main.cpp @@ -11,6 +11,10 @@ #include #include #include +#include +#include +#include +#include int main(int argc, char *argv[]) { @@ -49,9 +53,8 @@ int main(int argc, char *argv[]) }); QSpinBox *ageSpinBox = w.findChild("ageSpinBox"); - QObject::connect(ageSpinBox, &QSpinBox::valueChanged, [&](int value) { - user.setAge(value); - }); + QBindable ageBindable(ageSpinBox, "value"); + user.bindableAge().setBinding([ageBindable](){ return ageBindable.value();}); QLabel *priceDisplay = w.findChild("priceDisplay");