Commit 32ced34b authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Fix clipping

Change-Id: Iad309614756c5d57830382a4548b3faa9ed6b658
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 5671728a
......@@ -235,6 +235,8 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
{
painter->save();
qreal stripesWidth = 12;
QRegion innerRegion = QRegion(m_boundingRect.adjusted(stripesWidth, stripesWidth, -stripesWidth, -stripesWidth).toRect());
......@@ -243,7 +245,6 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
painter->setClipRegion(outerRegion);
painter->setClipping(true);
painter->fillRect(m_boundingRect.adjusted(1, 1, -1, -1), Qt::BDiagPattern);
painter->setClipping(false);
QString displayText = qmlItemNode().id();
......@@ -255,8 +256,6 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
if (m_boundingRect.height() > 60) {
painter->save();
QFont font;
font.setStyleHint(QFont::SansSerif);
font.setBold(true);
......@@ -279,9 +278,9 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
painter->setFont(font);
painter->setPen(QColor(48, 48, 96, 255));
painter->drawText(rotatedBoundingBox, displayText, textOption);
painter->restore();
}
painter->restore();
}
void FormEditorItem::paintComponentContentVisualisation(QPainter *painter, const QRectF &clippinRectangle) const
......
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