diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-07-09 08:47:46 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-07-09 08:50:00 (GMT) |
commit | 1e9a92cd6e8670a9dc90fed2044e7de38a3b13e6 (patch) | |
tree | 53334cc704c2e67bc55c876d6d64d457578b089b /src/gui/itemviews | |
parent | e02d97c50cee8bdc662bb1183ed01aa0dac53f01 (diff) | |
download | Qt-1e9a92cd6e8670a9dc90fed2044e7de38a3b13e6.zip Qt-1e9a92cd6e8670a9dc90fed2044e7de38a3b13e6.tar.gz Qt-1e9a92cd6e8670a9dc90fed2044e7de38a3b13e6.tar.bz2 |
Incorrect assertion in item views
we were checking if the parent of main items was QModelIndex
instead if checking if it is just invalid (it might have a pointer
to its model and still be invalid).
Task-number: QTBUG-12090
Reviewed-by: Ian Walters
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 15e59ba..302aa20 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -653,7 +653,7 @@ void QAbstractItemView::setModel(QAbstractItemModel *model) "QAbstractItemView::setModel", "A model should return the exact same index " "(including its internal id/pointer) when asked for it twice in a row."); - Q_ASSERT_X(d->model->index(0,0).parent() == QModelIndex(), + Q_ASSERT_X(!d->model->index(0,0).parent().isValid(), "QAbstractItemView::setModel", "The parent of a top level index should be invalid"); |