What are you doing with the layout after adding QGraphicsView ? You need to set it on a widget:
Qt Code:
  1. QLayout * layout = new QVBoxLayout();
  2. layout->addWidget(view);
  3. QWidget * w = new QWidget();
  4. w->setLayout(layout);
  5. w->show();
To copy to clipboard, switch view to plain text mode