Results 1 to 3 of 3

Thread: How to load image without using QGraphicsView?

  1. #1
    Join Date
    Sep 2012
    Posts
    66
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question How to load image without using QGraphicsView?

    I want to load an image that is not the background image without using QGraphicsView. How can I do with this?

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to load image without using QGraphicsView?

    use QLabel and set the pixmap like this:-

    Qt Code:
    1. QLabel *label = new QLabel(this);
    2. QPixmap pix;
    3. pix.load(const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
    4. label->setPixmap (pix);
    To copy to clipboard, switch view to plain text mode 
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

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

    chong_kimkeang (10th October 2012)

  4. #3
    Join Date
    Sep 2012
    Posts
    66
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to load image without using QGraphicsView?

    Thanks ,I found it already.

Similar Threads

  1. how to load image from one ui to another
    By trupti in forum Newbie
    Replies: 4
    Last Post: 3rd January 2011, 12:03
  2. how to load image from one ui to another
    By trupti in forum Qt Programming
    Replies: 0
    Last Post: 3rd January 2011, 05:43
  3. how do load image
    By yuvaraj.yadav in forum Qt Programming
    Replies: 5
    Last Post: 21st April 2009, 05:31
  4. Is there a better way to load a big image?
    By learning_qt in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2008, 15:00
  5. best way to load image from db
    By C167 in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 18:24

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.