From 2ff797689d480ee3fc22c9c4a271593b9cec24db Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Wed, 23 Feb 2022 15:01:08 +0100 Subject: Remove unused Qt4-compat test There was a test for Qt4 compatibility in tst_qheaderview. We don't run it since Qt 6. This patch removes the unused code. Change-Id: I751829ac5a142e79379e81e9e739107544cf7406 Reviewed-by: Arnaud Bienner Reviewed-by: David Faure --- .../itemviews/qheaderview/tst_qheaderview.cpp | 41 ---------------------- 1 file changed, 41 deletions(-) (limited to 'tests/auto/widgets/itemviews') diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index d81c10573e..7b4646fc6f 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -171,7 +171,6 @@ private slots: void moveSectionAndReset(); void moveSectionAndRemove(); void saveRestore(); - void restoreQt4State(); void restoreToMoreColumns(); void restoreToMoreColumnsNoMovedColumns(); void restoreBeforeSetModel(); @@ -1765,46 +1764,6 @@ void tst_QHeaderView::saveRestore() QVERIFY(!h2.restoreState(QByteArrayLiteral("Garbage"))); } -void tst_QHeaderView::restoreQt4State() -{ -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // QTBUG-40462 - // Setting from Qt4, where information about multiple sections were grouped together in one - // sectionItem object - QStandardItemModel m(4, 10); - QHeaderView h2(Qt::Vertical); - QByteArray settings_qt4 = - QByteArray::fromHex("000000ff00000000000000010000000100000000010000000000000000000000000000" - "0000000003e80000000a0101000100000000000000000000000064ffffffff00000081" - "0000000000000001000003e80000000a00000000"); - QVERIFY(h2.restoreState(settings_qt4)); - int sectionItemsLengthTotal = 0; - for (int i = 0; i < h2.count(); ++i) - sectionItemsLengthTotal += h2.sectionSize(i); - QCOMPARE(sectionItemsLengthTotal, h2.length()); - - // Buggy setting where sum(sectionItems) != length. Check false is returned and this corrupted - // state isn't restored - QByteArray settings_buggy_length = - QByteArray::fromHex("000000ff000000000000000100000000000000050100000000000000000000000a4000" - "000000010000000600000258000000fb0000000a010100010000000000000000000000" - "0064ffffffff00000081000000000000000a000000d30000000100000000000000c800" - "000001000000000000008000000001000000000000005c00000001000000000000003c" - "0000000100000000000002580000000100000000000000000000000100000000000002" - "580000000100000000000002580000000100000000000003c000000001000000000000" - "03e8"); - int old_length = h2.length(); - QByteArray old_state = h2.saveState(); - // Check setting is correctly recognized as corrupted - QVERIFY(!h2.restoreState(settings_buggy_length)); - // Check nothing has been actually restored - QCOMPARE(h2.length(), old_length); - QCOMPARE(h2.saveState(), old_state); -#else - QSKIP("Qt4 compatibility no longer needed in Qt6"); -#endif -} - void tst_QHeaderView::restoreToMoreColumns() { // Restore state onto a model with more columns -- cgit v1.2.3