aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmldelegatemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/types/qqmldelegatemodel.cpp')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 41970ce626..6732be9844 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -2093,9 +2093,7 @@ void QQmlDelegateModelItem::Dispose()
void QQmlDelegateModelItem::setModelIndex(int idx, int newRow, int newColumn)
{
- if (idx == index)
- return;
-
+ const int prevIndex = index;
const int prevRow = row;
const int prevColumn = column;
@@ -2103,8 +2101,8 @@ void QQmlDelegateModelItem::setModelIndex(int idx, int newRow, int newColumn)
row = newRow;
column = newColumn;
- Q_EMIT modelIndexChanged();
-
+ if (idx != prevIndex)
+ emit modelIndexChanged();
if (row != prevRow)
emit rowChanged();
if (column != prevColumn)