Change GraphicsView settings to be more in line with Qml

Task-Number: BAUHAUS-567
Reviewed-by: kkoehne
This commit is contained in:
Marco Bubke
2010-04-12 12:42:24 +02:00
committed by Kai Koehne
parent 3351f942f6
commit 02f297be26
3 changed files with 6 additions and 2 deletions

View File

@@ -43,8 +43,9 @@ FormEditorGraphicsView::FormEditorGraphicsView(QWidget *parent) :
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setResizeAnchor(QGraphicsView::AnchorViewCenter);
// setCacheMode(QGraphicsView::CacheNone);
setCacheMode(QGraphicsView::CacheBackground);
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
// setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
setRenderHint(QPainter::Antialiasing, false);

View File

@@ -67,6 +67,7 @@ FormEditorScene::FormEditorScene(FormEditorWidget *view, FormEditorView *editorV
m_formLayerItem->setZValue(0.0);
m_formLayerItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
view->setScene(this);
setItemIndexMethod(QGraphicsScene::NoIndex);
// setItemIndexMethod(QGraphicsScene::NoIndex);
}

View File

@@ -95,8 +95,10 @@ NodeInstanceView::NodeInstanceView(QObject *parent)
m_blockStatePropertyChanges(false)
{
m_graphicsView->setAttribute(Qt::WA_DontShowOnScreen, true);
m_graphicsView->setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
m_graphicsView->setOptimizationFlags(QGraphicsView::DontSavePainterState);
m_graphicsView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
m_graphicsView->setScene(new QGraphicsScene(m_graphicsView.data()));
m_graphicsView->scene()->setItemIndexMethod(QGraphicsScene::NoIndex);
}