[Qt-interest] Strange QGraphicsItemAnimation behavior

Thomas Fjellstrom tfjellstrom at shaw.ca
Mon Jan 4 16:57:44 CET 2010


On Mon January 4 2010, you wrote:
> I think you should use the new animation API.

I am planning on upgrading to Qt 4.6, but not right away. Probably when it 
makes it into Debian Sid's repo.

> 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.
> 

That would result in the same problem I'm seeing now. One timer seems to 
effect the rest for no good reason I can think of. I want items to keep 
animating till they stop, not jitter around when others are running.

> 
> ----- 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