Results 1 to 2 of 2

Thread: Should I delete QMovie object when I'm done with it?

  1. #1
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Should I delete QMovie object when I'm done with it?

    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).
    Qt Code:
    1. void MyDialog::showInfo()
    2. {
    3. ...
    4. ui.loadingLabel->setMovie(loadingMovie);
    5. ...
    6. }
    To copy to clipboard, switch view to plain text mode 

    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?
    It's not the goodbye that hurts,but the flashback that follow.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Should I delete QMovie object when I'm done with it?

    Quote Originally Posted by MorrisLiang View Post
    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.

  3. The following user says thank you to tbscope for this useful post:

    MorrisLiang (3rd June 2010)

Similar Threads

  1. Replies: 1
    Last Post: 19th February 2010, 11:02
  2. Replies: 2
    Last Post: 19th July 2009, 11:44
  3. How to safely delete an Object?
    By dbrmik in forum Qt Programming
    Replies: 2
    Last Post: 6th March 2009, 17:23
  4. Replies: 4
    Last Post: 19th February 2009, 11:10
  5. Is it bad to delete an object during its event handler?
    By codeslicer in forum Qt Programming
    Replies: 3
    Last Post: 30th December 2008, 16:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.