diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-18 13:13:10 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-18 13:13:10 (GMT) |
commit | 3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2 (patch) | |
tree | b35fb5f723752378dd4fede93a6c35c0aeb85ad2 /tests/auto/modeltest/dynamictreemodel.cpp | |
parent | 1aeccd6bd14d7d9e098e333715f63e0225cd4a54 (diff) | |
parent | 2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff) | |
download | Qt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.zip Qt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.tar.gz Qt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.tar.bz2 |
Merge remote-tracking branch 'origin/4.8'
Diffstat (limited to 'tests/auto/modeltest/dynamictreemodel.cpp')
-rw-r--r-- | tests/auto/modeltest/dynamictreemodel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/modeltest/dynamictreemodel.cpp b/tests/auto/modeltest/dynamictreemodel.cpp index fa634b6..80708d4 100644 --- a/tests/auto/modeltest/dynamictreemodel.cpp +++ b/tests/auto/modeltest/dynamictreemodel.cpp @@ -44,6 +44,7 @@ #include <QtCore/QHash> #include <QtCore/QList> #include <QtCore/QTimer> +#include <QtCore/QDebug> DynamicTreeModel::DynamicTreeModel(QObject *parent) @@ -66,9 +67,11 @@ QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &pare const qint64 grandParent = findParentId(parent.internalId()); if (grandParent >= 0) { QList<QList<qint64> > parentTable = m_childItems.value(grandParent); - Q_ASSERT(parent.column() < parentTable.size()); + if (parent.column() >= parentTable.size()) + qFatal("%s: parent.column() must be less than parentTable.size()", Q_FUNC_INFO); QList<qint64> parentSiblings = parentTable.at(parent.column()); - Q_ASSERT(parent.row() < parentSiblings.size()); + if (parent.row() >= parentSiblings.size()) + qFatal("%s: parent.row() must be less than parentSiblings.size()", Q_FUNC_INFO); } if (childIdColumns.size() == 0) @@ -189,7 +192,8 @@ QModelIndex ModelChangeCommand::findIndex(QList<int> rows) while (i.hasNext()) { parent = m_model->index(i.next(), col, parent); - Q_ASSERT(parent.isValid()); + if (!parent.isValid()) + qFatal("%s: parent must be valid", Q_FUNC_INFO); } return parent; } |