slint/examples/cpptest/main.cpp
Simon Hausmann f2df9293a9 Fix the C++ build
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.
2020-05-28 12:07:11 +02:00

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);
}