summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-11-25 12:28:07 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-12-02 15:16:49 +0100
commit97cfd4940157817dd761fd02f2e6da4afc5b4a30 (patch)
tree0fe42a95fd24ae57a5cfce52b809b4f17ecf77da /src
parent4a8bc3f9cc295058fb93b500c4d8ba2aedccb3aa (diff)
Don't let text table cells shrink below their minimum width
We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Pick-to: 6.2 5.15 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 699d8e5fd3..ff0c035a90 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2369,6 +2369,7 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
// constraint the maximumWidth by the minimum width of the fixed size floats, to
// keep them visible
layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth);
+ layoutStruct.minimumWidth = floatMinWidth;
// as floats in cells get added to the table's float list but must not affect
// floats in other cells we must clear the list here.