diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-04-16 08:40:11 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-04-16 10:48:00 (GMT) |
commit | f8fba0d48a1f30540ddf15f0d36f415b192d1d8b (patch) | |
tree | e001d3557b4f9db0cafcb7141c0555f3961cd58f /tests | |
parent | c2f89fd0d9d13a0da1ecc33414860795721261a7 (diff) | |
download | Qt-f8fba0d48a1f30540ddf15f0d36f415b192d1d8b.zip Qt-f8fba0d48a1f30540ddf15f0d36f415b192d1d8b.tar.gz Qt-f8fba0d48a1f30540ddf15f0d36f415b192d1d8b.tar.bz2 |
Fix crash in the SQLQueryModel tests
Amend fd5f83e612729cebc5395c992bd98628bb9ea25f
calling fetchMore in create_mapping was a bad idea bacause it may lead
to infinite recurtion
Make a special case for hasChildren instead
Task-number: 250023
Reviewed-by: Marius Bugge Monsen
BT: yes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 0509d49..4a749f0 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -2596,7 +2596,11 @@ class QtTestModel: public QAbstractItemModel } void fetchMore(const QModelIndex &idx) { + if (fetched.contains(idx)) + return; + beginInsertRows(idx, 0, rows-1); fetched.insert(idx); + endInsertRows(); } bool hasChildren(const QModelIndex & = QModelIndex()) const { @@ -2607,7 +2611,7 @@ class QtTestModel: public QAbstractItemModel return fetched.contains(parent) ? rows : 0; } int columnCount(const QModelIndex& parent = QModelIndex()) const { - return fetched.contains(parent) ? cols : 0; + return cols; } QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const |