summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@qt.io>2019-05-03 15:47:57 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2019-05-09 12:01:38 +0000
commit2b7edd053404f4819abf0203bb9c762799849638 (patch)
treeec7986c0673ffeb21f3c04703fd459d04118b818 /tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
parent7dd71e812542c561a00dd792d314843a81c5687c (diff)
Fix bug with QLayout::replaceWidget(a, a)
It should effectively leave the layout untouched Fixes: QTBUG-69706 Change-Id: I4d8232895bf1d1ae0d1b73156ef6ec6001d8968a Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp')
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index fa9769a002..8dd9d7c428 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -571,6 +571,10 @@ void tst_QBoxLayout::replaceWidget()
QCOMPARE(boxLayout->indexOf(replaceFrom), 1);
QCOMPARE(boxLayout->indexOf(replaceTo), -1);
+ QCOMPARE(boxLayout->count(), 3);
+ boxLayout->replaceWidget(replaceFrom, replaceFrom);
+ QCOMPARE(boxLayout->count(), 3);
+
delete boxLayout->replaceWidget(replaceFrom, replaceTo);
QCOMPARE(boxLayout->indexOf(replaceFrom), -1);