From 2dad9862cbf07e5decaef80a4e942378062f901d Mon Sep 17 00:00:00 2001 From: KIU Shueng Chuan Date: Thu, 13 May 2021 09:02:42 +0800 Subject: [PATCH] add QApplication.exec() to Qt5 bindings --- pyqtgraph/Qt.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py index 6dd05468..4fd257df 100644 --- a/pyqtgraph/Qt.py +++ b/pyqtgraph/Qt.py @@ -273,6 +273,13 @@ if QT_LIB in [PYQT5, PYQT6, PYSIDE2, PYSIDE6]: QtGui.QApplication.setGraphicsSystem = None +if QT_LIB in [PYQT5, PYSIDE2]: + # Some constructs are getting deprecated in Qt6 + # recreate the Qt6 structure + + QtWidgets.QApplication.exec = QtWidgets.QApplication.exec_ + + if QT_LIB in [PYQT6, PYSIDE6]: # We're using Qt6 which has a different structure so we're going to use a shim to # recreate the Qt5 structure