From 7e7f5f97832e8bf0b260f21aa912812eefaa5997 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 27 Dec 2021 18:48:31 +0100 Subject: [PATCH] Use block char format to render list item bullets and numbers It needs to be rendered with the format of the block not the format of the first letter of the block; otherwise if the first letter is black or italics or something, but the rest of the block isn't, the list item text looks out of place. Task-number: QTBUG-3583 Fixes: QTBUG-99148 Pick-to: 6.3 6.2 5.15 Change-Id: I63d8d6d6b7cee6bd9938fe1cf42a5f90da1bc0d3 Reviewed-by: Shawn Rutledge --- src/gui/text/qtextdocumentlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 1cc891ed5a..d8feaee4de 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2128,7 +2128,7 @@ void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *p { Q_Q(const QTextDocumentLayout); const QTextBlockFormat blockFormat = bl.blockFormat(); - const QTextCharFormat charFormat = QTextCursor(bl).charFormat(); + const QTextCharFormat charFormat = bl.charFormat(); QFont font(charFormat.font()); if (q->paintDevice()) font = QFont(font, q->paintDevice());