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 .
 Advanced user
					
					
						Advanced user
					
					
                                        
					
						
							
								 
							
						
					
					
						 QTimeLine
 QTimeLine
		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 .
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QTimeLine
 Re: QTimeLine
		How exactly do you change the time line objects? Post some code, if possible.
 Advanced user
					
					
						Advanced user
					
					
                                        
					
						
							
								 
							
						
					
					
						 Re: QTimeLine
 Re: QTimeLine
		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
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QTimeLine
 Re: QTimeLine
		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)
 Advanced user
					
					
						Advanced user
					
					
                                        
					
						
							
								 
							
						
					
					
						 Re: QTimeLine
 Re: QTimeLine
		thanks for pasting the perfect code .
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QTimeLine
 Re: QTimeLine
		If you want to reset the time line, why don't you use QTimeLine::setCurrentTime(0)?
 Advanced user
					
					
						Advanced user
					
					
                                        
					
						
							
								 
							
						
					
					
						 Re: QTimeLine
 Re: QTimeLine
		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