diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2017-12-11 14:48:00 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2017-12-11 14:16:49 +0000 |
commit | 44c02b52a3b12b0ed2485ce38ad824bec9764a97 (patch) | |
tree | c2dae770c8cb0190a0b00f668da2c0fef8627fdb /src | |
parent | a53df3892a70f99910cfd085f2f2feca9e17d081 (diff) | |
download | qt-creator-44c02b52a3b12b0ed2485ce38ad824bec9764a97.tar.gz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index 1fa95273ff..54d5d1536d 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -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) |