Results 1 to 10 of 10

Thread: Load an image in QLabel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Load an image in QLabel

    jpg are correct and qWarning output is

    30583

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Load an image in QLabel

    Sorry if I bother you, but then it must be in your code. Last debug question (with your image):
    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv)
    4. {
    5. QApplication app(argc, argv);
    6.  
    7. QImage image;
    8. bool result = image.load( "/qt/qtsdk-2009.01/qt/src/3rdparty/libtiff/html/images/smallliz.jpg" );
    9. qWarning() << result;
    10.  
    11. QLabel lab;
    12. lab.setPixmap(QPixmap::fromImage(image));
    13. lab.show();
    14.  
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 

    don't work? Here on my linux machine it works as expected.

  3. #3
    Join Date
    Feb 2009
    Posts
    32
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Load an image in QLabel

    ok thanks the problem was installation of qt... the static mode don't load jpg becouse it find pluging thanks for help

Similar Threads

  1. Replies: 7
    Last Post: 13th August 2008, 18:27
  2. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  3. Show Image on a QLabel
    By ^NyAw^ in forum Newbie
    Replies: 11
    Last Post: 15th April 2008, 15:45
  4. Replies: 13
    Last Post: 18th February 2008, 00:20
  5. Set the image at the center in QLabel?
    By vishal.chauhan in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2007, 14:07

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.