From e40fdf19abd4fe6d8f3a31088671bfc1c4aa03cc Mon Sep 17 00:00:00 2001 From: Even Oscar Andersen Date: Tue, 25 Jun 2024 11:51:47 +0200 Subject: wasm: hellogl2 screen is black We need to reset the OpenGL state in paintGL for the drawing to work, Also, disable the dock/add window functionality as it does not work on webassembly. Change-Id: I480d944bc2029a07d5d49f0a85c3754fbc8cd53c Reviewed-by: Lorn Potter --- examples/opengl/hellogl2/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/opengl/hellogl2/mainwindow.cpp') diff --git a/examples/opengl/hellogl2/mainwindow.cpp b/examples/opengl/hellogl2/mainwindow.cpp index 5ee2b738c2f..3f57b4fe30c 100644 --- a/examples/opengl/hellogl2/mainwindow.cpp +++ b/examples/opengl/hellogl2/mainwindow.cpp @@ -11,12 +11,13 @@ MainWindow::MainWindow() { +#ifndef Q_OS_WASM QMenu *menuWindow = menuBar()->addMenu(tr("&Window")); menuWindow->addAction(tr("Add new"), QKeySequence(Qt::CTRL | Qt::Key_N), this, &MainWindow::onAddNew); menuWindow->addAction(tr("Quit"), QKeySequence(Qt::CTRL | Qt::Key_Q), qApp, QApplication::closeAllWindows); - +#endif onAddNew(); } -- cgit v1.2.3