subsurface/qt-models
Jan Mulder dd87350cb7 mobile: stay on same dive after edit
See issue #875. In hindsight the reason for this bug is easy to
understand. When updating a dive, the dive was first removed
from the model, and added in its new state again. This does seems
resonable, but the delete in the model causes the internal (QML)
state to be changed, and the previous state (like the currentIndex
that was pointing to the just deleted row, so that one is changed to
something valid internally) is not restored at recreation of
the edited dive. The QML engine has no way to understand that
the remove and subsequent add are in fact one atomic operation.

This can be solved by simply updating the underlying data in
place, and notifying the change using a dataChanged emitted
signal. The dataChanged signal takes care of the repaint of
the screen, and there is no need for removeRow/insertRow pairs.

Fixes: #875

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-14 08:53:06 -08:00
..
cleanertablemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cleanertablemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
CMakeLists.txt Remove unused divesitepicturemodel from qt-models 2017-12-13 05:48:20 -08:00
completionmodels.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
completionmodels.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cylindermodel.cpp Prevent redundant replanning 2017-12-01 15:47:51 -08:00
cylindermodel.h Planner: Autom. move first datapoint gas to first gaslist position 2017-10-16 17:14:17 +02:00
divecomputerextradatamodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputerextradatamodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
diveimportedmodel.cpp Only call autogroup when it's enabled 2017-11-25 08:12:28 -08:00
diveimportedmodel.h QML UI: clear the previous list when downloading 2017-06-16 01:22:44 -07:00
divelistmodel.cpp mobile: stay on same dive after edit 2017-12-14 08:53:06 -08:00
divelistmodel.h QML UI: add downloaded dives to dive list 2017-05-28 11:54:33 -07:00
divelocationmodel.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
divelocationmodel.h Remove unused method LocationInformationModel::addDiveSite() 2017-11-26 23:37:01 +01:00
divepicturemodel.cpp Enable removal of pictures from different dives at the same moment 2017-12-13 05:48:20 -08:00
divepicturemodel.h Dive pictures show pictures of all selected dives 2017-12-13 05:48:20 -08:00
diveplannermodel.cpp Cleanup: mark parameter as potentially unused 2017-12-08 16:29:49 +01:00
diveplannermodel.h Actually compute variations in background 2017-12-01 15:47:51 -08:00
diveplotdatamodel.cpp Hand planner variables to profile 2017-11-25 20:13:01 +01:00
diveplotdatamodel.h Localize global planner state 2017-11-25 20:13:01 +01:00
divetripmodel.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
divetripmodel.h Display units in dive list table based on prefs option 2017-10-09 11:49:29 +03:00
filtermodels.cpp Inform LocationFilterModel of added dive site name 2017-11-26 18:50:40 -08:00
filtermodels.h Inform LocationFilterModel of added dive site name 2017-11-26 18:50:40 -08:00
gpslistmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
gpslistmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
maplocationmodel.cpp map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
maplocationmodel.h map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
messagehandlermodel.cpp Android: write appLog to file 2017-07-09 17:40:29 -07:00
messagehandlermodel.h Make message handler write to console as well 2017-06-11 13:55:41 -07:00
models.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
models.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
tankinfomodel.cpp tankinfomodel.cpp: clamp row index to [0 - MAX_TANK_INFO] 2017-06-15 14:48:49 -07:00
tankinfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weigthsysteminfomodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weigthsysteminfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
yearlystatisticsmodel.cpp Creation of dive duration string and surface interval string 2017-05-26 15:50:52 -07:00
yearlystatisticsmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00