Results 1 to 13 of 13

Thread: refresh image in a Qlabel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2013
    Location
    Bangalore,India
    Posts
    64
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default Re: refresh image in a Qlabel

    I am sorry,but couldn't understand by "Make QPixmap as class member".
    I have now reset the image everytime after the image has changed.
    It's only a temporary fix.
    Isn't there anything where I only have to give the refernce of the file and the QLabel changes automatically whenever the picture changes.

  2. #2
    Join Date
    Dec 2012
    Posts
    197
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    25
    Thanked 41 Times in 33 Posts

    Default Re: refresh image in a Qlabel

    Quote Originally Posted by prkhr4u
    I am sorry,but couldn't understand by "Make QPixmap as class member".
    Declare QPixmap it in the header file as a private or public... member and initialize or define it in your .cpp file then you might be able to find an approach to solve your problem.

    Good Luck.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: refresh image in a Qlabel

    Quote Originally Posted by prkhr4u View Post
    Isn't there anything where I only have to give the refernce of the file and the QLabel changes automatically whenever the picture changes.
    No, there is not anything something like this. QLabel doesn't keep track of QPixmap changes, you have to reset the pixmap each time it has been changed in order to make correct rendering by QLabel.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. The following user says thank you to spirit for this useful post:

    prkhr4u (19th October 2013)

Similar Threads

  1. Where can Qlabel keep its image?
    By hind in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2013, 04:11
  2. Image in QLabel not being displayed
    By P@u1 in forum Qt Programming
    Replies: 2
    Last Post: 4th July 2011, 10:47
  3. Replies: 2
    Last Post: 14th January 2011, 16:09
  4. Replies: 6
    Last Post: 21st September 2009, 11:55
  5. QLabel as an image.
    By RSX in forum Newbie
    Replies: 2
    Last Post: 4th April 2009, 20:22

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.