PDA

View Full Version : Should I delete QMovie object when I'm done with it?



MorrisLiang
3rd June 2010, 15:02
I have a dialog which shows email infomations.Before the infomations arrive,I set a QLabel in the dialog to show a loading animation.I use QMovie to load the gif file(/pics/loading.gif).


void MyDialog::showInfo()
{
...
ui.loadingLabel->setMovie(loadingMovie);
...
}


Now,my question is:
When I receive the infomations from the net.I hide the loadingLabel.In the meanwhile,should I delete the QMovie(i.e. loadingMovie) and create a new one next time I need to show loading animation?
And what is the best way if I want to display the loading animation in difference places?

tbscope
3rd June 2010, 15:14
When I receive the infomations from the net.I hide the loadingLabel.In the meanwhile,should I delete the QMovie(i.e. loadingMovie) and create a new one next time I need to show loading animation?
No, you don't need to delete it. You may though, but that's up to you.
Why do you ask to delete it?


And what is the best way if I want to display the loading animation in difference places?
Always call first or ring the door bell before you enter a house to show the loading animation.
In other words: define different places.