QmlDesigner: Enable clipping in FormEditorItem

When resizing an item the instanceIsRenderPixmap can be bigger than
the bounding rect. In this case we get painting artefacts.

Change-Id: I6da43f16a1e85d045a0ebbb01db594979ad89622
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2017-12-11 14:48:00 +01:00
parent a53df3892a
commit 44c02b52a3

View File

@@ -338,6 +338,9 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
if (isInStackedContainer)
showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible();
painter->setClipRegion(m_boundingRect.toRect());
painter->setClipping(true);
if (!hideCompletely) {
if (showPlaceHolder) {
if (scene()->showBoundingRects() && m_boundingRect.width() > 15 && m_boundingRect.height() > 15)