At least this works for me:
Qt Code:
  1. #include <QtGui>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. QApplication a(argc, argv);
  6.  
  7. QGraphicsItem* item = scene.addRect(QRectF(0,0,25,25));
  8. item->setFlag(QGraphicsItem::ItemIsMovable);
  9.  
  10. view.setScene(&scene);
  11. QLabel* label = new QLabel("Test", &view);
  12. Q_UNUSED(label);
  13.  
  14. view.show();
  15. return a.exec();
  16. }
To copy to clipboard, switch view to plain text mode