Results 1 to 3 of 3

Thread: QLabel based Custom Widget contains QMovie to support GIF Rendering

  1. #1
    Join Date
    Jan 2009
    Posts
    53
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question QLabel based Custom Widget contains QMovie to support GIF Rendering

    Hi,

    I have a custom widget based on QLabel, which it includes the QMovie.

    I did overwrite the paintEvent(QPaintEvent* event).

    Added QMovie->setFileName(GifFilePath); and QLabel->setMovie(QMovie); in the paintEvent function.

    However, QMovie->isValid() returns false for me. I use isValid() as validation before I start the QMovie.

    Why my QMovie is not valid?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QLabel based Custom Widget contains QMovie to support GIF Rendering

    first of all you should not set the movie in paintevent.. there is not need for overriding the paintevent..
    secondly can we see the code? QLabel->setMovie(QMovie) will not compile for me

  3. #3
    Join Date
    Jan 2009
    Posts
    53
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QLabel based Custom Widget contains QMovie to support GIF Rendering

    Hi @MrDeath, thanks for helping me again in another thread here.

    Qt Code:
    1. void QLabel::setMovie ( QMovie * movie )
    To copy to clipboard, switch view to plain text mode 

    So, I should not put it in paintEvent? I would like to show / hide it when user do something.

Similar Threads

  1. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 15:06

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.