From e0c22e27965bd6b44d7e07a175561d0b4b8ef164 Mon Sep 17 00:00:00 2001 From: Martin Fitzpatrick Date: Fri, 14 Feb 2014 11:05:10 +0100 Subject: [PATCH] Adding some additional deprectated APIs for Qt5. Example plots (mostly) working. This adds some remaining APIs that were deprecated in Qt5. These are easy to do as they're all documented, e.g. http://qt-project.org/doc/qt-5.0/qtwidgets/qgraphicsitem-compat.html Tested with most of the examples. Although I can't be sure as I don't know what the 'correct' output is, they look like they work. Some issues with interaction e.g. on the color bar plot. --- pyqtgraph/Qt.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py index 5d137fb8..b7a479b7 100644 --- a/pyqtgraph/Qt.py +++ b/pyqtgraph/Qt.py @@ -121,10 +121,18 @@ elif USE_QT_PY == PYQT5: self.setRotation(self.rotation() + angle) QtWidgets.QGraphicsItem.rotate = rotate + def translate(self, dx, dy): + self.setTransform(QtGui.QTransform.fromTranslate(dx, dy), True) + QtWidgets.QGraphicsItem.translate = translate def setMargin(self, i): - self.setContentsMargins( i, i, i, i) + self.setContentsMargins(i, i, i, i) QtWidgets.QGridLayout.setMargin = setMargin + + def setResizeMode(self, mode): + self.setSectionResizeMode(mode) + QtWidgets.QHeaderView.setResizeMode = setResizeMode + QtGui.QApplication = QtWidgets.QApplication QtGui.QGraphicsScene = QtWidgets.QGraphicsScene