[Qt-interest] Strange QGraphicsItemAnimation behavior

Thomas Fjellstrom tfjellstrom at shaw.ca
Mon Jan 4 05:58:27 CET 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GameBoardSquare.cpp
Type: text/x-c++src
Size: 3041 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100103/4028e6fd/attachment.bin 


More information about the Qt-interest-old mailing list