Commit c6d0f497 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.FormEditor: Fix repaint artefacts

parent d7132fea
......@@ -48,7 +48,7 @@ FormEditorGraphicsView::FormEditorGraphicsView(QWidget *parent) :
setResizeAnchor(QGraphicsView::AnchorViewCenter);
setCacheMode(QGraphicsView::CacheNone);
// setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setOptimizationFlags(QGraphicsView::DontSavePainterState);
// setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
setRenderHint(QPainter::Antialiasing, false);
......@@ -113,7 +113,7 @@ void FormEditorGraphicsView::keyPressEvent(QKeyEvent *event)
void FormEditorGraphicsView::setRootItemRect(const QRectF &rect)
{
m_rootItemRect = rect;
update();
viewport()->update();
}
QRectF FormEditorGraphicsView::rootItemRect() const
......@@ -304,11 +304,12 @@ void FormEditorGraphicsView::setFeedbackNode(const QmlItemNode &node)
}
}
void FormEditorGraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
void FormEditorGraphicsView::drawBackground(QPainter *painter, const QRectF &rectangle)
{
painter->save();
painter->setBrushOrigin(0, 0);
painter->fillRect(rect.intersected(rootItemRect()), backgroundBrush());
painter->fillRect(rectangle.intersected(rootItemRect()), backgroundBrush());
// paint rect around editable area
painter->setPen(Qt::black);
painter->drawRect( rootItemRect());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment