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 :
QNodesView
::QNodesView(QWidget* parent
){
setRenderHint
(QPainter::Antialiasing,
true);
setBackgroundBrush
(QImage(":/pureStudio/Images/pgEditorBG.png"));
// Multi-selection
// NoDrag, ScrollHandDrag, RubberBandDrag
// Optimization
// Drag & drop
setAcceptDrops(true);
}
QNodesView::QNodesView(QWidget* parent)
:QGraphicsView(parent), _zoomLevel(0), _zoomValue(1.0f)
{
setRenderHint(QPainter::Antialiasing, true);
setBackgroundBrush(QImage(":/pureStudio/Images/pgEditorBG.png"));
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
// Multi-selection
setDragMode(QGraphicsView::RubberBandDrag);
// NoDrag, ScrollHandDrag, RubberBandDrag
// Optimization
setOptimizationFlags(QGraphicsView::DontClipPainter);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing);
setCacheMode(QGraphicsView::CacheBackground);
// Drag & drop
setAcceptDrops(true);
}
To copy to clipboard, switch view to plain text mode
Bookmarks