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.9 6.8
Task-number: QTBUG-136755
Change-Id: Ie0b51b773e0127cac797607a52947bba7ec5eba0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Laszlo Agocs 2025-05-13 14:36:21 +02:00
parent b0b9adf066
commit d22660a09d
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);