mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 04:18:14 +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
|
|
@ -151,9 +151,6 @@ TEST_CASE("Image")
|
|||
{
|
||||
using namespace slint;
|
||||
|
||||
// ensure a backend exists, using private api
|
||||
private_api::WindowRc wnd;
|
||||
|
||||
Image img;
|
||||
{
|
||||
auto size = img.size();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue