Commit 079e6cb8 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

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's avatarTim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 82d928d1
......@@ -46,10 +46,17 @@ TextEditItemWidget::~TextEditItemWidget()
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);
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
......
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