profile: move initialization code to ProfileScene

A first in a number of commits to move code from the profile
view to the scene.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-06-05 18:49:00 +02:00 committed by Dirk Hohndel
parent 15342232ca
commit c8b3ac0f99
2 changed files with 2 additions and 2 deletions

View file

@ -3,6 +3,8 @@
ProfileScene::ProfileScene() ProfileScene::ProfileScene()
{ {
setSceneRect(0, 0, 100, 100);
setItemIndexMethod(QGraphicsScene::NoIndex);
} }
ProfileScene::~ProfileScene() ProfileScene::~ProfileScene()

View file

@ -466,10 +466,8 @@ ItemPos::ItemPos()
void ProfileWidget2::setupSceneAndFlags() void ProfileWidget2::setupSceneAndFlags()
{ {
setScene(profileScene.get()); setScene(profileScene.get());
scene()->setSceneRect(0, 0, 100, 100);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scene()->setItemIndexMethod(QGraphicsScene::NoIndex);
setOptimizationFlags(QGraphicsView::DontSavePainterState); setOptimizationFlags(QGraphicsView::DontSavePainterState);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform); setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);