On 04/04/11 03:20, Thomas Perl wrote:
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.
This still doesn't seem to start the animation. But i figured it out, I
also had to make the animation private variable e.g. self.anim
An unrelated style suggestion:
QtCore.QObject.connect(anim, QtCore.SIGNAL("finished()"), anim,
QtCore.SLOT("deleteLater()"))
can be rewritten as:
anim.finished.connect(anim.deleteLater)
Thanx
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 :)
I don't really know QML very well, the animation will be used throughout
the whole ui.
HTH.
Thomas
Thanks a lot,
Mark
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside