Hi Mark,
2011/4/4 Mark Baas <[email protected]>:
> I’m struggling to get an animation working. It seems that animation outside
> of my class work fine, however as soon as I run them from withing the class,
> they refuse to start. Can anyone tell me what’s wrong with my code: [...]
"pixmap" falls out of scope after the end of "loadImage". You can
avoid this by assigning it to e.g. "self.pixmap", so that a reference
to it is preserved after loadImage is done.
An unrelated style suggestion:
QtCore.QObject.connect(anim, QtCore.SIGNAL("finished()"), anim,
QtCore.SLOT("deleteLater()"))
can be rewritten as:
anim.finished.connect(anim.deleteLater)
Judging from the current code you have here, QML would be better for
such an animated QGraphicsView-based UI. But then I don't know what
you plan to add :)
HTH.
Thomas
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside