mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/summary: create DiveSummaryModel
Instead of passing the dive summary via a completely unstructured QStringList to QML, implement a dynamic model. For potential reuse on desktop (though somewhat unlikely) the model has two interfaces, one for QtWidgets and one for QML. The former is based on columns, whereas the later is based on roles. The number of columns is set dynamically. The roles currently support access to two columns. If more columns should be accessed from QML, more roles have to be added manually. This commit only creates the model and hooks it into QMLs global context, but does not yet change the QML page. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
48ccd114fc
commit
1a85b0e941
5 changed files with 322 additions and 0 deletions
|
@ -115,6 +115,7 @@ SOURCES += ../../subsurface-mobile-main.cpp \
|
|||
../../mobile-widgets/qmlmanager.cpp \
|
||||
../../mobile-widgets/themeinterface.cpp \
|
||||
../../qt-models/divelistmodel.cpp \
|
||||
../../qt-models/divesummarymodel.cpp \
|
||||
../../qt-models/diveplotdatamodel.cpp \
|
||||
../../qt-models/gpslistmodel.cpp \
|
||||
../../qt-models/completionmodels.cpp \
|
||||
|
@ -251,6 +252,7 @@ HEADERS += \
|
|||
../../mobile-widgets/themeinterface.h \
|
||||
../../map-widget/qmlmapwidgethelper.h \
|
||||
../../qt-models/divelistmodel.h \
|
||||
../../qt-models/divesummarymodel.h \
|
||||
../../qt-models/diveplotdatamodel.h \
|
||||
../../qt-models/gpslistmodel.h \
|
||||
../../qt-models/divelocationmodel.h \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue