mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Further simplify renderer storage in C++ platform API
Using an std::optional is even simpler and avoids a malloc.
This commit is contained in:
parent
b47936d4cd
commit
ef4074b041
3 changed files with 10 additions and 14 deletions
|
@ -55,9 +55,7 @@ private:
|
|||
cbindgen_private::slint_window_adapter_new(
|
||||
this, [](void *wa) { delete reinterpret_cast<const WindowAdapter *>(wa); },
|
||||
[](void *wa) {
|
||||
return reinterpret_cast<const WindowAdapter *>(wa)
|
||||
->renderer()
|
||||
.renderer_handle();
|
||||
return reinterpret_cast<WindowAdapter *>(wa)->renderer().renderer_handle();
|
||||
},
|
||||
[](void *wa) { reinterpret_cast<const WindowAdapter *>(wa)->show(); },
|
||||
[](void *wa) { reinterpret_cast<const WindowAdapter *>(wa)->hide(); },
|
||||
|
@ -97,7 +95,7 @@ public:
|
|||
|
||||
/// Re-implement this function to provide a reference to the renderer for use with the window
|
||||
/// adapter.
|
||||
virtual AbstractRenderer &renderer() const = 0;
|
||||
virtual AbstractRenderer &renderer() = 0;
|
||||
|
||||
/// Return the slint::Window associated with this window.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue