forked from qt-creator/qt-creator
QmlDesigner: Fix ugly paint glitch
The text inline editing has an ugly cursor rendering glitch with Qt 5.8. When we render the widget "manually" using grab then things seem to be ok. Change-Id: Idd00044de783164ca4ec021ae4c7b9f15302c2cb Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -46,10 +46,17 @@ TextEditItemWidget::~TextEditItemWidget()
|
|||||||
setWidget(0);
|
setWidget(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditItemWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void TextEditItemWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||||
{
|
{
|
||||||
painter->fillRect(boundingRect(), Qt::white);
|
painter->fillRect(boundingRect(), Qt::white);
|
||||||
QGraphicsProxyWidget::paint(painter, option, widget);
|
|
||||||
|
/* Cursor painting is broken.
|
||||||
|
* QGraphicsProxyWidget::paint(painter, option, widget);
|
||||||
|
* We draw manually instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
QPixmap pixmap = widget()->grab();
|
||||||
|
painter->drawPixmap(0, 0, pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit* TextEditItemWidget::lineEdit() const
|
QLineEdit* TextEditItemWidget::lineEdit() const
|
||||||
|
|||||||
Reference in New Issue
Block a user