From 9b450b297f8b26f7d19e9163953ffb98c328aaf6 Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Mon, 11 Apr 2016 21:37:27 -0700 Subject: [PATCH 1/2] Encode QPropertyAnimation property name if not passed as bytes. --- pyqtgraph/graphicsItems/CurvePoint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyqtgraph/graphicsItems/CurvePoint.py b/pyqtgraph/graphicsItems/CurvePoint.py index bb6beebc..c2a6db84 100644 --- a/pyqtgraph/graphicsItems/CurvePoint.py +++ b/pyqtgraph/graphicsItems/CurvePoint.py @@ -91,6 +91,9 @@ class CurvePoint(GraphicsObject): pass def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1): + # automatic encoding when QByteString expected was removed in PyQt v5.5 + if not isinstance(prop, bytes): + prop = prop.encode('latin-1') anim = QtCore.QPropertyAnimation(self, prop) anim.setDuration(duration) anim.setStartValue(start) From 9e4443cc68d3a16b7e250d015b94b81c2e78143c Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Thu, 21 Apr 2016 12:02:49 -0700 Subject: [PATCH 2/2] More detailed comment. --- pyqtgraph/graphicsItems/CurvePoint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/CurvePoint.py b/pyqtgraph/graphicsItems/CurvePoint.py index c2a6db84..f7682a43 100644 --- a/pyqtgraph/graphicsItems/CurvePoint.py +++ b/pyqtgraph/graphicsItems/CurvePoint.py @@ -91,7 +91,9 @@ class CurvePoint(GraphicsObject): pass def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1): - # automatic encoding when QByteString expected was removed in PyQt v5.5 + # In Python 3, a bytes object needs to be used as a property name in + # QPropertyAnimation. PyQt stopped automatically encoding a str when a + # QByteArray was expected in v5.5 (see qbytearray.sip). if not isinstance(prop, bytes): prop = prop.encode('latin-1') anim = QtCore.QPropertyAnimation(self, prop)