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 <shawn.rutledge@qt.io>
This commit is contained in:
Albert Astals Cid 2021-12-27 18:48:31 +01:00 committed by Shawn Rutledge
parent a06ea83eab
commit 7e7f5f9783

View File

@ -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());