I also created a test program like this
#include <QApplication>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
int main( int argc, char **argv )
{
scene.setSceneRect( -100.0, -100.0, 200.0, 200.0 );
item
->setPixmap
(QPixmap("qt4-logo.png"));
scene.addItem(item);
view.
setRenderHints( QPainter::Antialiasing );
view.show();
return app.exec();
}
#include <QApplication>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
int main( int argc, char **argv )
{
QApplication app(argc, argv);
QGraphicsScene scene;
scene.setSceneRect( -100.0, -100.0, 200.0, 200.0 );
QGraphicsPixmapItem *item = new QGraphicsPixmapItem(QPixmap("qt4-logo.png"), 0, &scene);
item->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
item->setPixmap(QPixmap("qt4-logo.png"));
scene.addItem(item);
QGraphicsView view( &scene );
view.setRenderHints( QPainter::Antialiasing );
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
still, nothing is displayed . here's a screenshot of the test app.
Bookmarks