summaryrefslogtreecommitdiffstats
path: root/src/testlib/qabstractitemmodeltester.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qabstractitemmodeltester.cpp')
-rw-r--r--src/testlib/qabstractitemmodeltester.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/testlib/qabstractitemmodeltester.cpp b/src/testlib/qabstractitemmodeltester.cpp
index a85b291220..1cd18b98bb 100644
--- a/src/testlib/qabstractitemmodeltester.cpp
+++ b/src/testlib/qabstractitemmodeltester.cpp
@@ -570,7 +570,7 @@ void QAbstractItemModelTesterPrivate::checkChildren(const QModelIndex &parent, i
// recursively go down the children
if (model->hasChildren(index) && currentDepth < 10)
- checkChildren(index, ++currentDepth);
+ checkChildren(index, currentDepth + 1);
// make sure that after testing the children that the index doesn't change.
QModelIndex newerIndex = model->index(r, c, parent);
@@ -720,12 +720,12 @@ void QAbstractItemModelTesterPrivate::rowsAboutToBeRemoved(const QModelIndex &pa
Changing c;
c.parent = parent;
c.oldSize = model->rowCount(parent);
- if (start > 0) {
+ if (start > 0 && model->columnCount(parent) > 0) {
const QModelIndex startIndex = model->index(start - 1, 0, parent);
MODELTESTER_VERIFY(startIndex.isValid());
c.last = model->data(startIndex);
}
- if (end < c.oldSize - 1) {
+ if (end < c.oldSize - 1 && model->columnCount(parent) > 0) {
const QModelIndex endIndex = model->index(end + 1, 0, parent);
MODELTESTER_VERIFY(endIndex.isValid());
c.next = model->data(endIndex);
@@ -845,3 +845,5 @@ bool QAbstractItemModelTesterPrivate::compare(const T1 &t1, const T2 &t2,
QT_END_NAMESPACE
+
+#include "moc_qabstractitemmodeltester.cpp"