forked from qt-creator/qt-creator
QmlDesigner: Fix clipping
Change-Id: Iad309614756c5d57830382a4548b3faa9ed6b658 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -235,6 +235,8 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
|
|||||||
|
|
||||||
void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
|
void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
|
||||||
{
|
{
|
||||||
|
painter->save();
|
||||||
|
|
||||||
qreal stripesWidth = 12;
|
qreal stripesWidth = 12;
|
||||||
|
|
||||||
QRegion innerRegion = QRegion(m_boundingRect.adjusted(stripesWidth, stripesWidth, -stripesWidth, -stripesWidth).toRect());
|
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->setClipRegion(outerRegion);
|
||||||
painter->setClipping(true);
|
painter->setClipping(true);
|
||||||
painter->fillRect(m_boundingRect.adjusted(1, 1, -1, -1), Qt::BDiagPattern);
|
painter->fillRect(m_boundingRect.adjusted(1, 1, -1, -1), Qt::BDiagPattern);
|
||||||
painter->setClipping(false);
|
|
||||||
|
|
||||||
QString displayText = qmlItemNode().id();
|
QString displayText = qmlItemNode().id();
|
||||||
|
|
||||||
@@ -255,8 +256,6 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
|
|||||||
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||||
|
|
||||||
if (m_boundingRect.height() > 60) {
|
if (m_boundingRect.height() > 60) {
|
||||||
painter->save();
|
|
||||||
|
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setStyleHint(QFont::SansSerif);
|
font.setStyleHint(QFont::SansSerif);
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
@@ -279,9 +278,9 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
|
|||||||
painter->setFont(font);
|
painter->setFont(font);
|
||||||
painter->setPen(QColor(48, 48, 96, 255));
|
painter->setPen(QColor(48, 48, 96, 255));
|
||||||
painter->drawText(rotatedBoundingBox, displayText, textOption);
|
painter->drawText(rotatedBoundingBox, displayText, textOption);
|
||||||
|
|
||||||
painter->restore();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorItem::paintComponentContentVisualisation(QPainter *painter, const QRectF &clippinRectangle) const
|
void FormEditorItem::paintComponentContentVisualisation(QPainter *painter, const QRectF &clippinRectangle) const
|
||||||
|
|||||||
Reference in New Issue
Block a user