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.
This commit is contained in:
Martin Fitzpatrick 2014-02-14 11:05:10 +01:00
parent b244805bde
commit e0c22e2796

View File

@ -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