diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index ac32ee4968..556602b523 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -1576,6 +1576,12 @@ void tst_QComboBox::setModel() box.setModel(new QStandardItemModel(2,1, &box)); QCOMPARE(box.currentIndex(), 0); QVERIFY(box.model() != oldModel); + + // check that setting the very same model doesn't move the current item + box.setCurrentIndex(1); + QCOMPARE(box.currentIndex(), 1); + box.setModel(box.model()); + QCOMPARE(box.currentIndex(), 1); } void tst_QComboBox::setCustomModelAndView() |