mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00

Remove the Optional from the evaluation context passing for property evaluation. Unfortunately there are nullptr uses left on the C++ side, that need to be replaced with passing through.
23 lines
526 B
C++
23 lines
526 B
C++
#include "hello.h"
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
static Hello component;
|
|
|
|
component.foobar.set_handler([](auto...){
|
|
std::cout << "Hello from C++" << std::endl;
|
|
});
|
|
|
|
component.plus_clicked.set_handler([](auto...){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get(nullptr) + 1);
|
|
});
|
|
|
|
component.minus_clicked.set_handler([](auto...){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get(nullptr) - 1);
|
|
});
|
|
|
|
sixtyfps::run(&component);
|
|
|
|
}
|