From 4b975405d70529408b2422e42720a80152746c20 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 5 Oct 2016 14:27:55 +0200 Subject: QTextEdit: don't show placeholder text while composing text If using IM to compose text in QTextEdit, the placeholder text will show underneath until the text is committed. This patch will additionally check if the user is currently composing preedit text before deciding whether or not to draw the placeholder text. Task-number: QTBUG-55758 Change-Id: If7943c6c94fb96d46514a81caa118829e6e6a0f9 Reviewed-by: Liang Qi --- src/widgets/widgets/qtextedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets/qtextedit.cpp') diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 28666f76ce..7e4b86d8fd 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -1506,7 +1506,7 @@ void QTextEditPrivate::paint(QPainter *p, QPaintEvent *e) if (layout) layout->setViewport(QRect()); - if (!placeholderText.isEmpty() && doc->isEmpty()) { + if (!placeholderText.isEmpty() && doc->isEmpty() && !control->isPreediting()) { QColor col = control->palette().text().color(); col.setAlpha(128); p->setPen(col); -- cgit v1.2.3