summaryrefslogtreecommitdiff
path: root/tests/auto/qheaderview/tst_qheaderview.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-17 14:12:49 +0100
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-17 14:18:11 +0100
commitf9b0efc17962df74a67d81daca5814af93a5fb97 (patch)
treed160550030c0815544e580d734526f95d9b3bb38 /tests/auto/qheaderview/tst_qheaderview.cpp
parentee379340fcc5ebf8625906f42540c0fb3577f9ac (diff)
downloadqt4-tools-f9b0efc17962df74a67d81daca5814af93a5fb97.tar.gz
Fixed a potential crash in headerview when inserting a section
This could happen if a section was moved andthen hidden Task-number: QTBUG-8650 Reviewed-by: Andy Shaw
Diffstat (limited to 'tests/auto/qheaderview/tst_qheaderview.cpp')
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index 4642830f81..f6cd4e3f4e 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -192,6 +192,7 @@ private slots:
void task248050_hideRow();
void QTBUG6058_reset();
void QTBUG7833_sectionClicked();
+ void QTBUG8650_crashOnInsertSections();
protected:
QHeaderView *view;
@@ -2056,6 +2057,19 @@ void tst_QHeaderView::QTBUG7833_sectionClicked()
QCOMPARE(pressedSpy.at(2).at(0).toInt(), 0);
}
+void tst_QHeaderView::QTBUG8650_crashOnInsertSections()
+{
+ QStringList headerLabels;
+ QHeaderView view(Qt::Horizontal);
+ QStandardItemModel model(2,2);
+ view.setModel(&model);
+ view.moveSection(1, 0);
+ view.hideSection(0);
+
+ QList<QStandardItem *> items;
+ items << new QStandardItem("c");
+ model.insertColumn(0, items);
+}
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"