Add qt6 demo#15847
Conversation
|
Just FYI, SDL+Qt interop on Wayland is possible. See the end of https://github.com/libsdl-org/SDL/blob/main/docs/README-wayland.md |
Thanks, setting the global Is it possible to use the SDL wayland backend, wihout SDL in control of pumping events? |
|
Let's mark this draft until more kinks are worked out of the integration? |
|
For OpenGL, |
Indeed. This makes the vulkan, opengl and software renderer behave identical: the surface is colored green but the menu does not appear but is functional. The gpu renderer shows a transparent window with no menu, but the menu is also functional. |
|
Ah, the issue with the GPU renderer is the window having the hidden flag set. Once that is gone, it works. |
| MainWindow window; | ||
| window.show(); | ||
|
|
||
| return app.exec(); |
There was a problem hiding this comment.
| return app.exec(); | |
| const int ret = app.exec(); | |
| SDL_Quit(); | |
| return ret; |
Need to shut down SDL properly, or it can occasionally error on exit due to threads still running.
|
I'll have a couple of fixes for the main branch tomorrow that should clean up the other issues. |
|
@Kontrabant, the original demo has an issue where mouse down works, but mouse up doesn't get delivered on X11: |
f35b5d8 to
8bbb840
Compare
68867d8 to
ab343af
Compare
Those should work. The issue is when creating a window with the GL flag, then creating a GLES2 context, SDL wants to recreate the window, which fails since external windows can't be recreated. I think a special case for this particular path will work.
I don't think switching renderers on external windows is something that can be well supported. SDL destroys and recreates internally managed windows when switching renderers for a reason, and since this can't be done for external windows, it's going to be glitchy in some cases. I doubt this is something that most real world apps will be doing though. |
|
gles and gles2 should be fixed after rebasing on main. Switching from a GL renderer to the GPU renderer is still broken, but I think that's due to something conflicting at the driver level.
It looks like XI_ButtonPress events are received on presses, but for releases, only XI_RawButtonRelease is arriving. Is Qt somehow eating or suppressing the standard button release events? Maybe starting a grab?
I see the same on GNOME as well, but it's fine on KDE and Sway, so what's causing it is another mystery (maybe something related to dirty regions?) Someone familiar with the internals of Qt might know what is going on. |
Its clang-tidy is not compatible with c++17, required by Qt6
[sdl-ci-filter *]


Description
This is 99% copy-and-paste of the SDL demo project at https://github.com/slouken/SDL_Qt_Demo
I added argument parsing, and use it for overriding the SDL backend.
On (Fedora) Linux, the example currently only works with the x11 video driver.
Run
testqt6 --platform xcbto use the x11 back-end.Using
--platform waylandor--platform wayland-eglfails with a SIGABORT.Untested on Windows, apple and other platforms.
Existing Issue(s)