summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-24 01:00:14 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-10-24 10:23:44 +0200
commitb327807c5ed6f151bfb22c2fe204ed289a3b6254 (patch)
tree880a0e7664e1270f4f51ccf79a3cf2ddbcd7d810 /src/gui/text
parentaa4b0f5cb7e84046530fbc26581f777506fea658 (diff)
parentb61c6164c100defc519b178d73858df59cffc48d (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 7be114adf9..ed23a4d8d9 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2088,8 +2088,12 @@ void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *pain
tl->draw(painter, offset, selections, context.clip.isValid() ? (context.clip & clipRect) : clipRect);
- if ((context.cursorPosition >= blpos && context.cursorPosition < blpos + bllen)
- || (context.cursorPosition < -1 && !tl->preeditAreaText().isEmpty())) {
+ // if the block is empty and it precedes a table, do not draw the cursor.
+ // the cursor is drawn later after the table has been drawn so no need
+ // to draw it here.
+ if (!isEmptyBlockBeforeTable(frameIteratorForTextPosition(blpos))
+ && ((context.cursorPosition >= blpos && context.cursorPosition < blpos + bllen)
+ || (context.cursorPosition < -1 && !tl->preeditAreaText().isEmpty()))) {
int cpos = context.cursorPosition;
if (cpos < -1)
cpos = tl->preeditAreaPosition() - (cpos + 2);