diff options
author | Marco Bubke <marco.bubke@digia.com> | 2013-12-17 15:55:22 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@digia.com> | 2014-01-02 12:42:32 +0100 |
commit | 32ced34b4948d3cfb9a4ad8442da123e305ef666 (patch) | |
tree | dae7f5087ff5e3ffe27ee314e9cd2f991f41e9e5 /src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp | |
parent | 5671728a8a54d3f99a0203c69d3510ad677fa065 (diff) |
QmlDesigner: Fix clipping
Change-Id: Iad309614756c5d57830382a4548b3faa9ed6b658
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index 73ee950a2a..fbc8351901 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -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 |