mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
C++: Support of dynamic model and if expression
This commit is contained in:
parent
20369c7fc7
commit
90532e80d2
3 changed files with 100 additions and 51 deletions
|
@ -112,12 +112,12 @@ struct PropertyListenerScope
|
|||
}
|
||||
|
||||
template<typename F>
|
||||
bool evaluate(F &f) const {
|
||||
return internal::sixtyfps_property_listener_scope_evaluate(
|
||||
void evaluate(const F &f) const {
|
||||
internal::sixtyfps_property_listener_scope_evaluate(
|
||||
&inner,
|
||||
[](void *f){ (*reinterpret_cast<F*>(f))(); },
|
||||
&f
|
||||
);
|
||||
[](void *f){ (*reinterpret_cast<const F*>(f))(); },
|
||||
const_cast<F*>(&f)
|
||||
);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue