offscreen: Return the requested window format

Not the default constructed QSurfaceFormat.

If the window had alphaBufferSize set to some value, we want that
value returned from the platformwindow too.

Pick-to: 6.8
Task-number: QTBUG-136755
Change-Id: Ie0b51b773e0127cac797607a52947bba7ec5eba0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d22660a09d36818d4c39a6e6b85430c377849dfe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2025-05-13 14:36:21 +02:00 committed by Qt Cherry-pick Bot
parent 6b4e11e63e
commit 3cf76e81e5
2 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,11 @@ WId QOffscreenWindow::winId() const
return m_winId;
}
QSurfaceFormat QOffscreenWindow::format() const
{
return window()->requestedFormat();
}
QMargins QOffscreenWindow::frameMargins() const
{
return m_margins;

View File

@ -26,6 +26,7 @@ public:
void requestActivateWindow() override;
WId winId() const override;
QSurfaceFormat format() const override;
static QOffscreenWindow *windowForWinId(WId id);