summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2022-02-23 15:01:08 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2022-02-24 13:51:22 +0100
commit2ff797689d480ee3fc22c9c4a271593b9cec24db (patch)
tree5551cb868d7f1021c1170d96beae9d9765edab75 /tests/auto/widgets/itemviews
parent3fd43fafba338c8462bcb61f6763daa80963f9d6 (diff)
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 <arnaud.bienner@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests/auto/widgets/itemviews')
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp41
1 files changed, 0 insertions, 41 deletions
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