Feature request: Expose QApplication.nativeInterface

Zach Pearson zjp at cgl.ucsf.edu
Mon Aug 18 21:59:53 BST 2025


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?

— Zach



More information about the PyQt mailing list