[PyQt] Annoying TypeError with graphics animations
B. B.
thebbzoo at gmail.com
Sat Apr 11 22:28:19 BST 2009
Hello all,
I get some strange TypeErrors when I use the QGraphicsItemAnimation.
An example can be boiled down to the example below taken from the Qt
documentation :
http://doc.trolltech.com/4.5/qgraphicsitemanimation.html
What I get is this error, when the application is running.
"TypeError: native Qt signal is not callable"
I have installed the snapshot : PyQt-x11-gpl-4.5-snapshot-20090403.tar.gz
under python2.6 ( verified the error under python2.5 too )
I can hardly see that I do something wrong.. or is it my installation that
has failed??
best Regards
BBZ
# --------------------------- 8< --------------------------
import sys
from PyQt4.QtGui import QApplication , QGraphicsEllipseItem ,
QGraphicsItemAnimation
from PyQt4.QtGui import QGraphicsScene , QGraphicsView
from PyQt4.QtCore import SIGNAL , QPointF , QTimeLine
app = QApplication( sys.argv )
# create a graphicsview with a moving ball...
ball = QGraphicsEllipseItem(0, 0, 20, 20)
timer = QTimeLine(5000)
timer.setFrameRange(0, 100)
animation = QGraphicsItemAnimation()
animation.setItem(ball)
animation.setTimeLine(timer)
for i in xrange( 200 ) :
animation.setPosAt(i / 200.0, QPointF(i, i))
scene = QGraphicsScene()
scene.setSceneRect(0, 0, 250, 250)
scene.addItem(ball)
view = QGraphicsView(scene)
view.show()
timer.start()
app.exec_()
# --------------------------- 8< --------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090411/24c100db/attachment.html
More information about the PyQt
mailing list