[Qt-interest] Strange QGraphicsItemAnimation behavior
Jason H
scorp1us at yahoo.com
Mon Jan 4 16:36:53 CET 2010
I think you should use the new animation API. Using all those timelines sets up multiple timers. You need to use a singleton timer technique so there is only one timer driving all the events.
----- Original Message ----
From: Thomas Fjellstrom <tfjellstrom at shaw.ca>
To: Qt Devel <qt-interest at trolltech.com>
Sent: Sun, January 3, 2010 11:58:27 PM
Subject: [Qt-interest] Strange QGraphicsItemAnimation behavior
I'm having a small problem with multiple QGraphicsItemAnimation's and their
assigned QTimeLine objects being affected by other running QTimeLines.
Basically, I have a GameBoard (QGraphicsWidget sub) class that is filled
with many GameBoardSquare (QGraphicsWidget sub) classes (laid out in a
QGraphicsGridLayout), and each GameBoardSquare animates as the mouse enters,
and leaves the square. What I've found happens, is that when multiple
QGraphicsItemAnimations (with their respective QTimeLine) are running, they
are effected by other running animations for some reason.
I know the code I've attached isn't all that pretty, and the animation
handling isn't quite correct, but it aught to work. Mousing over an item,
without having been over another item for a long enough period as to wait
out any running animations, and the animation plays correctly. Mouse over an
item directly from another, or while another is animating, and you'll see
the item you have the mouse over jitter, or change its position incorrectly
while its animating, and most of the time, the final position is wrong as
well.
I'm using Qt 4.5.3 on debian linux.
--
Thomas Fjellstrom
tfjellstrom at shaw.ca
More information about the Qt-interest-old
mailing list