From 7f29368eccc9a06a4b817608887371225b0f2347 Mon Sep 17 00:00:00 2001 From: mae Date: Wed, 4 Nov 2009 17:06:11 +0100 Subject: QPlainTextEdit redraw issue in QTextControl There is an optimization in QTextControl, that it only requests updates for single blocks if only a single block was changed. This update was requested with the block's bounding rectangle. In the case of disabled line wrapping in combination with a very long line, a block change can result in a narrower block bounding rectangle. This then resulted in pixel on the screen not being redrawn properly. The fix enlarges the requested update rectangle horizontally. The bug was discovered during inhouse Qt Creator testing. Reviewed-by: Oswald Buddenhagen --- src/gui/text/qtextcontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 3f6545c..f5579b9 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1296,7 +1296,9 @@ QVariant QTextControl::loadResource(int type, const QUrl &name) void QTextControlPrivate::_q_updateBlock(const QTextBlock &block) { Q_Q(QTextControl); - emit q->updateRequest(q->blockBoundingRect(block)); + QRectF br = q->blockBoundingRect(block); + br.setRight(qreal(INT_MAX)); // the block might have shrunk + emit q->updateRequest(br); } QRectF QTextControlPrivate::rectForPosition(int position) const -- cgit v0.12