Dive locations: factor out common code of models

For increased maintainability, use the same columns, roles and
the same accessor function for both dive-site models.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-09 12:26:58 +02:00 committed by Dirk Hohndel
parent 19d651a36b
commit d6010b5155
4 changed files with 28 additions and 45 deletions

View file

@ -63,7 +63,6 @@ public:
class DiveLocationModel : public QAbstractTableModel {
Q_OBJECT
public:
enum columns{UUID, NAME, LATITUDE, LONGITUDE, DESCRIPTION, NOTES, COLUMNS};
DiveLocationModel(QObject *o = 0);
void resetModel();
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;