Merge pull request #309 from ixjlyons/fix-issue257
Encode QPropertyAnimation property name if not passed as bytes.
This commit is contained in:
commit
70626624ca
|
@ -91,6 +91,11 @@ class CurvePoint(GraphicsObject):
|
|||
pass
|
||||
|
||||
def makeAnimation(self, prop='position', start=0.0, end=1.0, duration=10000, loop=1):
|
||||
# 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)
|
||||
anim.setDuration(duration)
|
||||
anim.setStartValue(start)
|
||||
|
|
Loading…
Reference in New Issue
Block a user