From a9d70c8a596041f8cf19fd8979ca628824e17b46 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Fri, 1 Mar 2024 13:44:37 +0000 Subject: [PATCH] Added fix for using WebEngine and OpenGL in same glue session with Qt6 --- glue_qt/utils/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glue_qt/utils/app.py b/glue_qt/utils/app.py index 27eba7ec..a4838e86 100644 --- a/glue_qt/utils/app.py +++ b/glue_qt/utils/app.py @@ -1,6 +1,6 @@ import time import platform -from qtpy import QtCore, QtGui, QtWidgets +from qtpy import QtCore, QtGui, QtWidgets, QtQuick from glue.config import settings from glue._settings_helpers import save_settings @@ -47,6 +47,11 @@ def get_qapp(icon_path=None): # don't do it here and instead ask that the plugins do it in their # main __init__.py (which should get executed before glue is launched). + # NOTE: the following setting is needed to make sure we can use + # WebEngine at the same time as the OpenGL widget, at least on MacOS X. + # See https://bugreports.qt.io/browse/QTBUG-122886 for more details. + QtQuick.QQuickWindow.setGraphicsApi(QtQuick.QSGRendererInterface.GraphicsApi.OpenGL) + qapp = QtWidgets.QApplication(['']) qapp.setQuitOnLastWindowClosed(True)