Feature request: Expose QApplication.nativeInterface
Phil Thompson
phil at riverbankcomputing.com
Tue Aug 19 11:32:29 BST 2025
On 18/08/2025 21:59, Zach Pearson wrote:
> Hello,
>
> I was experimenting with making a toy Vulkan renderer with Python
> bindings, but I hit a roadblock creating surfaces on Linux. On macOS
> or Windows, you only need your desired window’s window_id to create a
> surface on it. But when you go to generate Vulkan surfaces on Linux
> you have to pass in handles to the program’s connection to the
> windowing system, and you have to get those from
> QApplication.instance().nativeInterface(). Depending on whether you’re
> using ‘wayland’ as your qt platform or ‘xcb’, you get back either
> QWaylandApplication or QX11Application, and then you can call
> display() or connection() respectively to get the data you need.
>
> On PySide6 using ‘xcb’ as the qt platform, you get a native interface
> back when you call QApplication.instance().nativeInterface(), though
> when using ‘wayland’ that call returns None (they plan to actually
> return QWaylandApplication in PySide6 6.10). On PyQt, I get an error
> ‘QApplication has no attribute nativeInterface’.
>
> Could you expose that attribute in a future release of PyQt6?
What would display() or connection() have to return to make them useful?
Phil
More information about the PyQt
mailing list