QAbstract3DGraph: fix null glGetString crash on Wayland


On the Wayland platform plugin (after ed4bf9c9930), makeCurrent() for a
zero-size window returns true without calling eglMakeCurrent, to satisfy
an NVIDIA requirement that wl_egl_window_resize runs from the render
thread with an active context. This left Qt's internal current-context
tracking out of sync with the EGL driver, so glGetString returned NULL
and triggered qFatal("GLSL version must be 1.20 or higher").

Fix by using a temporary QOffscreenSurface for the initialization-time
GL capability query. The offscreen path in
QWaylandGLContext::makeCurrent goes through QEGLPlatformContext and
always calls eglMakeCurrent, bypassing the zero-size window guard.
Switch to calling glGetString via the context's functions() object to
make the call site explicit about which context is queried.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pick-to: 6.12
Fixes: QTBUG-147587
Change-Id: Idd33f8bf3844377554bce33986ce67e1b6be6d6b
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
commit4839c43dbebdf5d7e132afe781b864f62996fc7d
parentd9afdf048d57f111b9fb059838c56e81d0198b9b
authorSami Varanka <sami.varanka@qt.io>
committerSami Varanka <sami.varanka@qt.io>
commit timeFri, 26 Jun 2026 05:47:23 +0000