Qt-interest Archive, October 2006
problem not show image on QGraphicsPixmapItem
Message 1 in thread
The below code of QT4.2 is to show image used by QGraphicsPixmapItem;
but the execution can't show the png image except black background.
Please give me help to resolve the problm. Thank you!!
-----------------
int main(int argc, char **argv) {
QApplication app(argc, argv);
QGraphicsScene scene;
scene.setBackgroundBrush(Qt::black);
scene.addPixmap(QPixmap("/image/pacman02.png"));
QGraphicsView view(&scene);
view.show();
return app.exec();
}
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.