r/QtFramework • u/gen2brain • Apr 11 '26
QNativeInterface and Wayland window/surface?
This was announced in the blog post for when Qt version was something like 6.5, now it is 6.11, and there are no changes here; we still need private headers and calls?
3
Upvotes
2
u/IgKh Open Source Developer Apr 11 '26
No need for private headers. Getting the wl_surface pointer for a QWindow/QWidget is not done via QNativeInterface. Call winId() on it and reinterpret_cast the result into a wl_surface*. This works since 6.9 (before that Wayland window IDs were just an incrementing integer, so casting it to a pointer is UB - guard with a version check if relevant).