summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 23427002a..8dc119ad8 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -94,8 +94,10 @@ void DiveListModel::removeDiveById(int id)
void DiveListModel::updateDive(int i, dive *d)
{
DiveObjectHelper *newDive = new DiveObjectHelper(d);
- m_dives.replace(i, newDive);
- emit dataChanged(createIndex(i, 0), createIndex(i, 0));
+ // we need to make sure that QML knows that this dive has changed -
+ // the only reliable way I've found is to remove and re-insert it
+ removeDive(i);
+ insertDive(i, newDive);
}
void DiveListModel::clear()