hi
i have a QGraphicsItemAnimation object which after certain period requires change of one QTimeLine(which is already set) to another QTimeLine .
if i do this then the program crashes .
is there any way to change the animations timeline .
hi
i have a QGraphicsItemAnimation object which after certain period requires change of one QTimeLine(which is already set) to another QTimeLine .
if i do this then the program crashes .
is there any way to change the animations timeline .
How exactly do you change the time line objects? Post some code, if possible.
hi
i want to reset(not restarting ) the timeline.
this code crashes
Qt Code:
ann->setTimeLine(timelineW); ann->setTimeLine(tim); //resetting to new timeline timelineW->start();To copy to clipboard, switch view to plain text mode
Beacause the item deletes the previous time line(if any) when you set a new one:
Therefore timelineW is invalid after you set tim as the new time line.Qt Code:
{ if (d->timeLine == timeLine) return; if (d->timeLine) delete d->timeLine; if (!timeLine) return; d->timeLine = timeLine; connect(timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(setStep(qreal))); }To copy to clipboard, switch view to plain text mode
You should call tim->start().
babu198649 (31st January 2008)
thanks for pasting the perfect code .
If you want to reset the time line, why don't you use QTimeLine::setCurrentTime(0)?
thanks.
the animation object should synchronize with the other items timer.If you want to reset the time line, why don't you use QTimeLine::setCurrentTime(0)?
Bookmarks