From 756fd345b2797f3d835ce96e95ee4b1ae387a7d5 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Fri, 1 Mar 2024 13:54:54 +0000 Subject: [PATCH] Only apply fix to Qt6 --- glue_qt/utils/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glue_qt/utils/app.py b/glue_qt/utils/app.py index a4838e86..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, QtQuick +from qtpy import QtCore, QtGui, QtWidgets, QtQuick, QT6 from glue.config import settings from glue._settings_helpers import save_settings @@ -50,7 +50,8 @@ def get_qapp(icon_path=None): # 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) + if QT6: + QtQuick.QQuickWindow.setGraphicsApi(QtQuick.QSGRendererInterface.GraphicsApi.OpenGL) qapp = QtWidgets.QApplication(['']) qapp.setQuitOnLastWindowClosed(True)