PDA

View Full Version : How to Display the image in Qt



sdastagirmca
10th February 2009, 06:59
Hi,

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


QGraphicsScene *scene = new QGraphicsScene(this);
scene->setSceneRect(0, 0, 465, 615);
setScene(scene);
QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/redwood.png"));
logo->setPos(30, 515);

setMinimumSize(470, 620);
setMaximumSize(470, 620);


but it shows setScene is not defined.




regards

S.Dastagir Hussain

spirit
10th February 2009, 07:17
you can simply use QLabel::setPixmap (http://doc.trolltech.com/4.4/qlabel.html#pixmap-prop).