summaryrefslogtreecommitdiff
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-02 07:28:25 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-02 08:09:31 +0200
commitf66a8edc200482308c8567395a7b6f95143c8f92 (patch)
treed374b1cc75139a0cf8aff20f1778a09f3c9c1a8b /tests/auto/widgets
parenta845e1db18fceb660bb8d8c339f4c1aa5d876927 (diff)
downloadqtbase-f66a8edc200482308c8567395a7b6f95143c8f92.tar.gz
Fix irrelevant error case in QSplitter test
The tst_QSplitter::replaceWidget() is testing that if you replace a longer QLabel with a shorter one in a horizontal splitter layout, then we *only* get a resize for the new, shorter label (expanding it horizontally to match the replaced widget, as documented). But the test accidentally triggered the QTextDocument backend for the QLabel by including HTML tags in its text. Due to QTBUG-82954, it is possible that the QTextDocument height includes the leading of the font in the last line, so if the default font has a leading, the new label will be higher than the QSplitter, and the splitter will expand its height, causing resizes for the other labels as well. Since this is not the case we are testing here, and it is currently blocking the fix for QTBUG-80554, we simply make the new label use the same plain text backend as the others. Task-number: QTBUG-82954 Change-Id: I6bfa1f3648b0fc9758c57ab2fa95be2451995df3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index cc65accdc3..332aa7c6d3 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -763,7 +763,7 @@ void tst_QSplitter::replaceWidget()
// the same size on the new widget. Because of QLabel's sizing
// constraints (they can expand but not shrink) the easiest is
// to set a shorter label.
- QLabel *newWidget = new QLabel(QLatin1String("<b>NEW</b>"));
+ QLabel *newWidget = new QLabel(QLatin1String("NEW"));
EventCounterSpy ef(&sp);
ef.installEventFilter();