From b6ce61f486a06ded273d518d871906f9a53ab7c1 Mon Sep 17 00:00:00 2001 From: Kari Hormi Date: Mon, 7 Oct 2019 16:21:33 +0300 Subject: Fix text not rendering properly after setAlignment call Sometimes when setAlignment is called, the text stops rendering correctly at some point. Adding relayoutDocument call to setAlignment fixes the problem. Fixes: QTBUG-78728 Change-Id: Iab1cf161f0c8d700804448733338c813b5bf9762 Reviewed-by: Ville Voutilainen --- src/widgets/widgets/qtextedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/widgets/qtextedit.cpp') diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 0ae63f2dd5..2b3a46ae56 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -746,6 +746,7 @@ void QTextEdit::setAlignment(Qt::Alignment a) QTextCursor cursor = d->control->textCursor(); cursor.mergeBlockFormat(fmt); d->control->setTextCursor(cursor); + d->relayoutDocument(); } /*! -- cgit v1.2.3