Fix the Qt native platform example

Fix regression introduced with commit d0cdc462c7:
The window surface must exists before querying for the window handles.
This commit is contained in:
Simon Hausmann 2023-05-17 14:59:16 +02:00
parent d9bc7a08f9
commit 3db5b97790

View file

@ -27,6 +27,8 @@ slint::cbindgen_private::PointerEventButton convert_button(Qt::MouseButtons b)
static slint_platform::NativeWindowHandle window_handle_for_qt_window(QWindow *window)
{
// Ensure that the native window surface exists
window->create();
#ifdef __APPLE__
QPlatformNativeInterface *native = qApp->platformNativeInterface();
void *nsview = native->nativeResourceForWindow(QByteArray("nsview"), window);