diff options
author | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-09-06 09:59:32 (GMT) |
---|---|---|
committer | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-09-06 09:59:32 (GMT) |
commit | 03b787cdadb966898c86a06747deb39e2f7dae2f (patch) | |
tree | 188d10557683fb95defc966829ff3d14bc404e37 /src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | |
parent | 5180a674358d5b295e5f7e01f28649176ec0d33a (diff) | |
parent | fded09d4e2983d7eed82c9fa5b678f70074473ba (diff) | |
download | Qt-03b787cdadb966898c86a06747deb39e2f7dae2f.zip Qt-03b787cdadb966898c86a06747deb39e2f7dae2f.tar.gz Qt-03b787cdadb966898c86a06747deb39e2f7dae2f.tar.bz2 |
Merge remote branch 'upstream/4.7' into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index b4e8bda..a46ee73 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -1305,24 +1305,27 @@ void QDeclarativeVisualDataModel::_q_itemsMoved(int from, int to, int count) void QDeclarativeVisualDataModel::_q_rowsInserted(const QModelIndex &parent, int begin, int end) { - if (!parent.isValid()) + Q_D(QDeclarativeVisualDataModel); + if (parent == d->m_root) _q_itemsInserted(begin, end - begin + 1); } void QDeclarativeVisualDataModel::_q_rowsRemoved(const QModelIndex &parent, int begin, int end) { - if (!parent.isValid()) + Q_D(QDeclarativeVisualDataModel); + if (parent == d->m_root) _q_itemsRemoved(begin, end - begin + 1); } void QDeclarativeVisualDataModel::_q_rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow) { + Q_D(QDeclarativeVisualDataModel); const int count = sourceEnd - sourceStart + 1; - if (!destinationParent.isValid() && !sourceParent.isValid()) { + if (destinationParent == d->m_root && sourceParent == d->m_root) { _q_itemsMoved(sourceStart, destinationRow, count); - } else if (!sourceParent.isValid()) { + } else if (sourceParent == d->m_root) { _q_itemsRemoved(sourceStart, count); - } else if (!destinationParent.isValid()) { + } else if (destinationParent == d->m_root) { _q_itemsInserted(destinationRow, count); } } @@ -1330,7 +1333,7 @@ void QDeclarativeVisualDataModel::_q_rowsMoved(const QModelIndex &sourceParent, void QDeclarativeVisualDataModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end) { Q_D(QDeclarativeVisualDataModel); - if (!begin.parent().isValid()) + if (begin.parent() == d->m_root) _q_itemsChanged(begin.row(), end.row() - begin.row() + 1, d->m_roles); } |