diff options
author | mae <qt-info@nokia.com> | 2009-11-04 16:06:11 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2009-11-04 16:06:11 (GMT) |
commit | 7f29368eccc9a06a4b817608887371225b0f2347 (patch) | |
tree | b9597b786023fca81c782b8e373facf6a83c20a4 /src/gui/text | |
parent | de2e9b75c3e71906322ffae1eaa4219a662266c2 (diff) | |
download | Qt-7f29368eccc9a06a4b817608887371225b0f2347.zip Qt-7f29368eccc9a06a4b817608887371225b0f2347.tar.gz Qt-7f29368eccc9a06a4b817608887371225b0f2347.tar.bz2 |
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
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 |