C++ interpreter API: add a Value::Value(int) constructor (#974)

This commit is contained in:
Olivier Goffart 2022-02-21 14:00:51 +01:00 committed by GitHub
parent ea2e91ece9
commit 350f0d0d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -366,6 +366,9 @@ public:
/// Constructs a new Value that holds the double \a value.
Value(double value) { cbindgen_private::slint_interpreter_value_new_double(value, &inner); }
/// Constructs a new Value that holds the int \a value.
/// Internally this is stored as a double and Value::type() will return Value::Type::Number.
Value(int value) : Value(static_cast<double>(value)) { }
/// Constructs a new Value that holds the string \a str.
Value(const SharedString &str)
{