mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
68414531ad
QML's ListView uses the "section" property to test if items belong to the same section. Apparently, this must be a string and therefore we can't pass e.g. a dive-trip object. Therefore a specially formatted string was passed in, which was guaranteed to be unique (contained the dive-trip pointer value) and the fully formatted trip-title and short-date. The disadvantage of that approach is that the formatting is performed for every dive and not every trip. Perhaps not a problem now, but it makes it for example necessary to cache the number of filtered dives. To be more flexible, pass in only the pointer value formatted as hexadecimal string and provide a function to convert that string back to a trip-pointer (in the form of a QVariant, so that it can be passed to QML). Moreover provide two functions for formatting the title and the short-date. The three new functions are members of DiveListSortModel. This might not be the perfect place, but it is easy to reach from the DiveListView. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> |
||
---|---|---|
.. | ||
cleanertablemodel.cpp | ||
cleanertablemodel.h | ||
CMakeLists.txt | ||
completionmodels.cpp | ||
completionmodels.h | ||
cylindermodel.cpp | ||
cylindermodel.h | ||
divecomputerextradatamodel.cpp | ||
divecomputerextradatamodel.h | ||
divecomputermodel.cpp | ||
divecomputermodel.h | ||
diveimportedmodel.cpp | ||
diveimportedmodel.h | ||
divelistmodel.cpp | ||
divelistmodel.h | ||
divelocationmodel.cpp | ||
divelocationmodel.h | ||
divepicturemodel.cpp | ||
divepicturemodel.h | ||
diveplannermodel.cpp | ||
diveplannermodel.h | ||
diveplotdatamodel.cpp | ||
diveplotdatamodel.h | ||
divetripmodel.cpp | ||
divetripmodel.h | ||
filtermodels.cpp | ||
filtermodels.h | ||
gpslistmodel.cpp | ||
gpslistmodel.h | ||
maplocationmodel.cpp | ||
maplocationmodel.h | ||
messagehandlermodel.cpp | ||
messagehandlermodel.h | ||
models.cpp | ||
models.h | ||
tankinfomodel.cpp | ||
tankinfomodel.h | ||
treemodel.cpp | ||
treemodel.h | ||
weightmodel.cpp | ||
weightmodel.h | ||
weightsysteminfomodel.cpp | ||
weightsysteminfomodel.h | ||
yearlystatisticsmodel.cpp | ||
yearlystatisticsmodel.h |