summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qlistwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qlistwidget.cpp')
-rw-r--r--src/gui/itemviews/qlistwidget.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp
index 5dd1d76..0ce0e5e 100644
--- a/src/gui/itemviews/qlistwidget.cpp
+++ b/src/gui/itemviews/qlistwidget.cpp
@@ -173,10 +173,11 @@ void QListModel::move(int srcRow, int dstRow)
{
if (srcRow == dstRow
|| srcRow < 0 || srcRow >= items.count()
- || dstRow < 0 || dstRow >= items.count())
+ || dstRow < 0 || dstRow > items.count())
return;
- beginMoveRows(QModelIndex(), srcRow, srcRow, QModelIndex(), dstRow);
+ if (!beginMoveRows(QModelIndex(), srcRow, srcRow, QModelIndex(), dstRow))
+ return;
if (srcRow < dstRow)
--dstRow;
items.move(srcRow, dstRow);