Hello I really need help. I need the simplest possible example for QGraphicsPixmapItem.

Maybe simple can be defined this way (but this is for QGraphicsEllipseItem)

Qt Code:
  1. #include <QGraphicsEllipseItem>
  2. #include <QGraphicsScene>
  3. #include <QGraphicsView>
  4.  
  5. int main( int argc, char **argv )
  6. {
  7. QApplication app(argc, argv);
  8.  
  9. scene.setSceneRect( -100.0, -100.0, 200.0, 200.0 );
  10.  
  11. QGraphicsEllipseItem *item = new QGraphicsEllipseItem( 0, &scene );
  12. item->setRect( -50.0, -50.0, 100.0, 100.0 );
  13.  
  14. QGraphicsView view( &scene );
  15. view.setRenderHints( QPainter::Antialiasing );
  16. view.show();
  17.  
  18. return app.exec();
To copy to clipboard, switch view to plain text mode