From 046622cdf3b6f856f67ab314c7758aca4dcf5494 Mon Sep 17 00:00:00 2001 From: Igor Mironchik Date: Thu, 18 Jan 2018 09:58:59 +0300 Subject: Fix explicitly set width not being respected The size of the QStaticText was always adjusted, even if setTextWidth() was used. Now size of the QStaticText is calculated according to the set width of the text, and if no width was set, then the automatically adjusted size is used. [ChangeLog][QtGui][QStaticText] Fixed explicitly set width not being respected. Task-number: QTBUG-65836 Change-Id: If2f9f6952fb168f4bcb6d8fabfdc7360f8a36485 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qstatictext.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 68f33a8ed7..2f90754274 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -662,9 +662,6 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p, document.documentLayout()->draw(p, ctx); p->restore(); - if (textWidth >= 0.0) - document.adjustSize(); // Find optimal size - actualSize = document.size(); } } -- cgit v1.2.3