Your problem is that your animation "frames" number is a function of the text size.
You should have that as a constant, if you want the same speed effect.
register int scrItembrw=scrItem->boundingRect().width();
for (register int i=0; i<(n+scrItembrw) /*this should be a constant*/; i=i+1)
{
register QPointF p
(0,h
);
//sets the position of scrItem p.setX(n-i);
p.setY(h);
animation->setPosAt(i/(n+scrItembrw),p);
}//end for
register int scrItembrw=scrItem->boundingRect().width();
for (register int i=0; i<(n+scrItembrw) /*this should be a constant*/; i=i+1)
{
register QPointF p(0,h); //sets the position of scrItem
p.setX(n-i);
p.setY(h);
animation->setPosAt(i/(n+scrItembrw),p);
}//end for
To copy to clipboard, switch view to plain text mode
Bookmarks