diff --git a/glue_qt/utils/app.py b/glue_qt/utils/app.py index 27eba7ec..8e1e22ef 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, QT6 from glue.config import settings from glue._settings_helpers import save_settings @@ -47,6 +47,12 @@ 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. + if QT6: + QtQuick.QQuickWindow.setGraphicsApi(QtQuick.QSGRendererInterface.GraphicsApi.OpenGL) + qapp = QtWidgets.QApplication(['']) qapp.setQuitOnLastWindowClosed(True)