Make property reference works in C++

This commit is contained in:
Olivier Goffart 2020-05-27 09:49:51 +02:00
parent 01fc0df1a2
commit 41332a759f
3 changed files with 14 additions and 17 deletions

View file

@ -9,7 +9,7 @@ int main() {
});
component.plus_clicked.set_handler([](auto...){
auto &counter = component.property_0_counter;
auto &counter = component.counter;
counter.set(counter.get() + 1);
// FIXME: this _13 is an internal detail and should be private anyway. We muse use some
// alias or way to expose the property (same for the _ before signals)
@ -18,7 +18,7 @@ int main() {
});
component.minus_clicked.set_handler([](auto...){
auto &counter = component.property_0_counter;
auto &counter = component.counter;
counter.set(counter.get() - 1);
component.counter_label_11.text.set(std::string_view(std::to_string(counter.get())));
std::cout << "MINUS: " << std::string_view(component.counter_label_11.text.get()) << std::endl;