summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-04-14 08:02:42 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-04-15 01:34:38 (GMT)
commit522e757b7b5fa9e18338b00eca1b12b79c1ff3e5 (patch)
tree035a8724703a5f873bd3b7435a22b31456e7ec23 /tests
parent80f0149ace017cefd7b0c7df14931b2bca31cd1a (diff)
downloadQt-522e757b7b5fa9e18338b00eca1b12b79c1ff3e5.zip
Qt-522e757b7b5fa9e18338b00eca1b12b79c1ff3e5.tar.gz
Qt-522e757b7b5fa9e18338b00eca1b12b79c1ff3e5.tar.bz2
Fix crash in QTreeView
Discovered in Kopete trunk BT: yes Reviewed-by: Thierry (cherry picked from commit 91aeceb7132f4afae0996443a162a5783d8f17aa)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 9c39bd6..87c1c7c 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -209,6 +209,8 @@ private slots:
void indexRowSizeHint();
void addRowsWhileSectionsAreHidden();
+ void filterProxyModelCrash();
+
// task-specific tests:
void task174627_moveLeftToRoot();
void task171902_expandWith1stColHidden();
@@ -2829,6 +2831,29 @@ void tst_QTreeView::indexRowSizeHint()
QCOMPARE(view.indexRowSizeHint(index), w->sizeHint().height());
}
+void tst_QTreeView::filterProxyModelCrash()
+{
+ QStandardItemModel model;
+ QList<QStandardItem *> items;
+ for (int i = 0; i < 100; i++)
+ items << new QStandardItem(QString::fromLatin1("item %1").arg(i));
+ model.appendColumn(items);
+
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+
+ QTreeView view;
+ view.setModel(&proxy);
+ view.show();
+ QTest::qWait(30);
+ proxy.invalidate();
+ view.verticalScrollBar()->setValue(15);
+ QTest::qWait(20);
+
+ proxy.invalidate();
+ view.repaint(); //used to crash
+}
+
class task174627_TreeView : public QTreeView
{
Q_OBJECT
@@ -3254,6 +3279,5 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
QVERIFY(o.count > 0);
}
-
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"