diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2017-07-19 12:07:17 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2017-10-12 13:33:29 +0000 |
commit | 0e1c9a34c204ca83688cae3ea2496506e8dcd548 (patch) | |
tree | dedd3d23454302a12489c3922354dd706c2b8d86 /src/widgets/widgets/qplaintextedit.h | |
parent | 55e273c1a2c6f739b4f25c0f983cb59254bc2c39 (diff) |
QPlainTextEdit: draw placeholder text correctly when it wraps
382faed introduced placeholder text to QPlainTextEdit. But the code
relied on the text begin short enough to fit inside the width of
the text edit. If the text was longer, and therefore wrapped, drawing
artifacts would show.
This patch will listen for text changes and check if the
placeholder text should show or not, and if so, issue a full update
to ensure that the whole placeholder text is either fully drawn
or hidden. And then we allow to the placeholder text to be drawn
inside the full rect of the text edit.
Task-number: QTBUG-61875
Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qplaintextedit.h')
-rw-r--r-- | src/widgets/widgets/qplaintextedit.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h index 2823aeeb74..34ec96715e 100644 --- a/src/widgets/widgets/qplaintextedit.h +++ b/src/widgets/widgets/qplaintextedit.h @@ -283,6 +283,7 @@ protected: private: Q_DISABLE_COPY(QPlainTextEdit) Q_PRIVATE_SLOT(d_func(), void _q_repaintContents(const QRectF &r)) + Q_PRIVATE_SLOT(d_func(), void _q_textChanged()) Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars()) Q_PRIVATE_SLOT(d_func(), void _q_verticalScrollbarActionTriggered(int)) Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged()) |