summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuhang Zhao <[email protected]>2023-06-20 11:29:21 +0800
committerYuhang Zhao <[email protected]>2023-06-22 09:15:03 +0800
commit33a9cbef657d598589500d2eecea192b83f79b3c (patch)
tree96a7b78e5f6bf2ecf250beb8f911df5b51187786 /src
parent3e801b5477a7abfe4b87f20639e345bf3dc7eca8 (diff)
WASM: don't ignore custom QSurfaceFormat settings
Previously, Qt would always ignore user's custom QSurfaceFormat settings and this behavior makes user have no way to control the preferred OpenGL version when running on WASM. And after reading the wasm platform plugin code, I don't see any reason why we should limit ourself to the default OpenGL version. And I've tested this patch locally, Qt still work normally if I set a newer OpenGL version. Pick-to: 6.6 6.5 Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e Reviewed-by: Morten Johan Sørvig <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp5
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp
index 46073302285..775f71b3ad3 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.cpp
+++ b/src/plugins/platforms/wasm/qwasmwindow.cpp
@@ -152,6 +152,11 @@ QWasmWindow::~QWasmWindow()
#endif
}
+QSurfaceFormat QWasmWindow::format() const
+{
+ return window()->requestedFormat();
+}
+
void QWasmWindow::onRestoreClicked()
{
window()->setWindowState(Qt::WindowNoState);
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h
index 0c523d3d9fa..37e186d7009 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.h
+++ b/src/plugins/platforms/wasm/qwasmwindow.h
@@ -49,6 +49,8 @@ public:
QWasmBackingStore *backingStore);
~QWasmWindow() final;
+ QSurfaceFormat format() const override;
+
void paint();
void setZOrder(int order);
void setWindowCursor(QByteArray cssCursorName);