mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Add Value bool conversion to C++
This commit is contained in:
parent
a34d6e6563
commit
831bf58baa
3 changed files with 26 additions and 2 deletions
|
@ -69,7 +69,14 @@ public:
|
|||
return {};
|
||||
}
|
||||
}
|
||||
std::optional<bool> to_bool() const;
|
||||
std::optional<bool> to_bool() const
|
||||
{
|
||||
if (auto *b = cbindgen_private::sixtyfps_interpreter_value_to_bool(&inner)) {
|
||||
return *b;
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
std::optional<sixtyfps::SharedVector<Value>> to_array() const;
|
||||
std::optional<std::shared_ptr<sixtyfps::Model<Value>>> to_model() const;
|
||||
std::optional<sixtyfps::Brush> to_brush() const;
|
||||
|
@ -81,7 +88,7 @@ public:
|
|||
{
|
||||
cbindgen_private::sixtyfps_interpreter_value_new_string(&str, &inner);
|
||||
}
|
||||
Value(bool);
|
||||
Value(bool b) { cbindgen_private::sixtyfps_interpreter_value_new_bool(b, &inner); }
|
||||
Value(const SharedVector<Value> &);
|
||||
Value(const std::shared_ptr<sixtyfps::Model<Value>> &);
|
||||
Value(const sixtyfps::Brush &);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue