Hi,

I have a QGraphicScene with 200 items and it is very slow when scrolling or moving the items !!!!

I setup my QGraphicsView this way :

Qt Code:
  1. QNodesView::QNodesView(QWidget* parent)
  2. :QGraphicsView(parent), _zoomLevel(0), _zoomValue(1.0f)
  3. {
  4. setRenderHint(QPainter::Antialiasing, true);
  5.  
  6. setBackgroundBrush(QImage(":/pureStudio/Images/pgEditorBG.png"));
  7. setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
  8.  
  9. // Multi-selection
  10. setDragMode(QGraphicsView::RubberBandDrag);
  11. // NoDrag, ScrollHandDrag, RubberBandDrag
  12.  
  13. // Optimization
  14. setOptimizationFlags(QGraphicsView::DontClipPainter);
  15. setOptimizationFlags(QGraphicsView::DontSavePainterState);
  16. setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing);
  17. setCacheMode(QGraphicsView::CacheBackground);
  18.  
  19. // Drag & drop
  20. setAcceptDrops(true);
  21. }
To copy to clipboard, switch view to plain text mode