mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +00:00
Make property reference works in C++
This commit is contained in:
parent
01fc0df1a2
commit
41332a759f
3 changed files with 14 additions and 17 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue