Results 1 to 2 of 2

Thread: How to Display the image in Qt

  1. #1
    Join Date
    Jan 2009
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy How to Display the image in Qt

    Hi,

    How to Display the image in Qt using Visual Studio.I'm using this code.

    Qt Code:
    1. QGraphicsScene *scene = new QGraphicsScene(this);
    2. scene->setSceneRect(0, 0, 465, 615);
    3. setScene(scene);
    4. QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/redwood.png"));
    5. logo->setPos(30, 515);
    6.  
    7. setMinimumSize(470, 620);
    8. setMaximumSize(470, 620);
    To copy to clipboard, switch view to plain text mode 

    but it shows setScene is not defined.




    regards

    S.Dastagir Hussain
    Last edited by jpn; 10th February 2009 at 16:50. Reason: missing [code] tags

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

    Default Re: How to Display the image in Qt

    you can simply use QLabel::setPixmap.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 2
    Last Post: 29th September 2008, 01:08
  2. Replies: 7
    Last Post: 13th August 2008, 19:27
  3. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 16:36
  4. Display only PNG image on desktop
    By durbrak in forum Qt Programming
    Replies: 32
    Last Post: 15th March 2008, 22:55
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36

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.