Results 1 to 5 of 5

Thread: QLabel -> setPixmap doesn't work in release build

  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QLabel -> setPixmap doesn't work in release build

    Hi All,

    I am using Qt 4.7.4 with Mingw 4.4. I have a weird problem when setting qlabel to display an image. In debug build, the image shows correctly in the label. But in release build, image doesn't show. But label itself is re-sized according to image. (I resize it with label->resize()) but image doesn't show. What might be the problem?

    ui->label->setPixmap(QPixmap("c:/images/image.tif"));
    ui->label->resize(ui->label->pixmap()->size());

    Thanks.
    Asanka

  2. #2
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: QLabel -> setPixmap doesn't work in release build

    Read this and see if it helps.
    Last edited by Urthas; 2nd March 2012 at 02:59.

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QLabel -> setPixmap doesn't work in release build

    I am not using relative paths. I use absolute paths. actually label resizes according to the image size but only thing is it is not displayed.

    Thanks

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QLabel -> setPixmap doesn't work in release build

    Is the release app running on the same machine as the debug one? Are the release mode TIF image plugins available on that machine?

    Post a small, self-contained, compilable example that demonstrates the problem on your machine. Don't forget to attach your TIF file.

  5. The following user says thank you to ChrisW67 for this useful post:

    ChrisOfBristol (4th April 2015)

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLabel -> setPixmap doesn't work in release build

    ... also test your code with a PNG file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    ChrisOfBristol (4th April 2015)

Similar Threads

  1. QLabel background color doesn't work in toolbars
    By iig in forum Qt Programming
    Replies: 0
    Last Post: 10th August 2010, 11:30
  2. QLabel setPixmap doesnt work
    By arpspatel in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2010, 22:24
  3. QLabel setPixmap only works twice?
    By December in forum Qt Programming
    Replies: 0
    Last Post: 28th February 2010, 10:59
  4. qlabel can't use setPixmap() function
    By emailhy in forum Qt Programming
    Replies: 1
    Last Post: 24th December 2009, 23:30
  5. QLabel not resize in setPixmap()
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 23rd October 2006, 12:21

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.