forked from qt-creator/qt-creator
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:
@@ -338,6 +338,9 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
|
|||||||
if (isInStackedContainer)
|
if (isInStackedContainer)
|
||||||
showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible();
|
showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible();
|
||||||
|
|
||||||
|
painter->setClipRegion(m_boundingRect.toRect());
|
||||||
|
painter->setClipping(true);
|
||||||
|
|
||||||
if (!hideCompletely) {
|
if (!hideCompletely) {
|
||||||
if (showPlaceHolder) {
|
if (showPlaceHolder) {
|
||||||
if (scene()->showBoundingRects() && m_boundingRect.width() > 15 && m_boundingRect.height() > 15)
|
if (scene()->showBoundingRects() && m_boundingRect.width() > 15 && m_boundingRect.height() > 15)
|
||||||
|
Reference in New Issue
Block a user