summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview/tst_qtreeview.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-17 07:23:47 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-04-17 07:23:47 (GMT)
commit58f8796ae4d9dcb9e741d2a07c87e6b82a2a4d9b (patch)
tree5f265a6f87cabef61dd763aab3d76e200d8d67a3 /tests/auto/qtreeview/tst_qtreeview.cpp
parentac7484e36bfab69473278d7268cf37f7c69abfd2 (diff)
parentd43d33eb3121519d0025ad433d5c186365c47ef6 (diff)
downloadQt-58f8796ae4d9dcb9e741d2a07c87e6b82a2a4d9b.zip
Qt-58f8796ae4d9dcb9e741d2a07c87e6b82a2a4d9b.tar.gz
Qt-58f8796ae4d9dcb9e741d2a07c87e6b82a2a4d9b.tar.bz2
Merge branch 'qt/main'
Conflicts: src/opengl/opengl.pro
Diffstat (limited to 'tests/auto/qtreeview/tst_qtreeview.cpp')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index e1d405d..a96dbac 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();
@@ -223,6 +225,7 @@ private slots:
void task238873_avoidAutoReopening();
void task244304_clickOnDecoration();
void task246536_scrollbarsNotWorking();
+ void task250683_wrongSectionSize();
};
class QtTestModel: public QAbstractItemModel
@@ -2829,6 +2832,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
@@ -3255,5 +3281,21 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
}
+void tst_QTreeView::task250683_wrongSectionSize()
+{
+ QDirModel model;
+ QTreeView treeView;
+ treeView.header()->setResizeMode(QHeaderView::ResizeToContents);
+ treeView.setModel(&model);
+ treeView.setColumnHidden(2, true);
+ treeView.setColumnHidden(3, true);
+
+ treeView.show();
+ QTest::qWait(100);
+
+ QCOMPARE(treeView.header()->sectionSize(0) + treeView.header()->sectionSize(1), treeView.viewport()->width());
+}
+
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"