summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-04-14 08:02:42 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-04-14 12:56:39 (GMT)
commit91aeceb7132f4afae0996443a162a5783d8f17aa (patch)
treec1559e76fdcc30f132cf9283b4ebaa492d24af70 /tests/auto/qtreeview
parente1a9014cc92091e8371f9a888ff94c694f562df0 (diff)
downloadQt-91aeceb7132f4afae0996443a162a5783d8f17aa.zip
Qt-91aeceb7132f4afae0996443a162a5783d8f17aa.tar.gz
Qt-91aeceb7132f4afae0996443a162a5783d8f17aa.tar.bz2
Fix crash in QTreeView
Discovered in Kopete trunk BT: yes Reviewed-by: Thierry
Diffstat (limited to 'tests/auto/qtreeview')
-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 e1d405d..dfccd9e 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"