summaryrefslogtreecommitdiffstats
path: root/qobjectlistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qobjectlistmodel.cpp')
-rw-r--r--qobjectlistmodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qobjectlistmodel.cpp b/qobjectlistmodel.cpp
index 92b4646..0ac41d7 100644
--- a/qobjectlistmodel.cpp
+++ b/qobjectlistmodel.cpp
@@ -228,7 +228,8 @@ void QObjectListModel::replace(int i, QObject *object)
void QObjectListModel::move(int from, int to)
{
- beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to+1 : to);
+ if (!beginMoveRows(QModelIndex(), from, from, QModelIndex(), to > from ? to+1 : to))
+ return; //should only be triggered for our simple case if from == to.
m_objects.move(from, to);
endMoveRows();
}