mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Port the C++ generator and C++ API to the new window ownership model
One key difference to the Rust way is what `slint::Window` means. In Rust that holds the `WindowInner` and `slint::Window` is only exposed as `&slint::Window`. This is possible because the component owns the `Rc<dyn PlatformWindow>`, which has a function to return the `&slint::Window`. In C++ `slint::Window` is also exposed as `slint::Window&` in the `window()` getter, but there's no way to get a reference to a C++ wrapper for the Rust `&slint::Window` that the `PlatformWindow` trait returns. Therefore in C++ `slint::Window` wraps `Rc<dyn PlatformWindow>`.
This commit is contained in:
parent
fd026a3991
commit
98e1befd0d
9 changed files with 26 additions and 30 deletions
|
|
@ -95,9 +95,6 @@ SCENARIO("Value API")
|
|||
|
||||
SECTION("Construct an image")
|
||||
{
|
||||
// ensure a backend exists, using private api
|
||||
slint::private_api::WindowRc wnd;
|
||||
|
||||
REQUIRE(!value.to_image().has_value());
|
||||
slint::Image image = slint::Image::load_from_path(
|
||||
SOURCE_DIR "/../../logo/slint-logo-square-light-128x128.png");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue