Hello everyone,
I am trying to display an image using QGraphicsView but all I get is a blank window.
Here is the code:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv)
  4. QGraphicsScene* scene = new QGraphicsScene(QRect(0, 0, 600, 400));
  5. QPixmap Pix("king.png");
  6. //does not work either
  7. //QGraphicsPixmapItem *item1 = scene->addPixmap(Pix);
  8. scene->addItem(item);
  9. view.setScene(scene);
  10. view.show();
  11. return a.exec();
  12. }
To copy to clipboard, switch view to plain text mode 

I think that I'm missing something obvious, but still I'm unable to find it on my own.
Any suggestions?