Fix rendering of the Qt platform example with high-dpi

- Provide a C++ platform event for the scale factor change and send it
- Report the correct logical and physical sizes to Slint
This commit is contained in:
Simon Hausmann 2023-05-24 15:33:37 +02:00 committed by Simon Hausmann
parent 459f810bd8
commit dd61890e23
3 changed files with 34 additions and 12 deletions

View file

@ -140,6 +140,15 @@ public:
}
}
/// Notifies the platform about a change in the device pixel ratio.
void dispatch_scale_factor_change_event(float factor)
{
private_api::assert_main_thread();
if (was_initialized) {
cbindgen_private::slint_windowrc_dispatch_scale_factor_change_event(&self, factor);
}
}
/// Returns true if the window is currently animating
bool has_active_animations() const
{