subsurface/qt-models/divelocationmodel.h
Tomaz Canabrava 6cd85d9b73 Simplify model handling and crashes fixes
So, there's only one crash left (that I put a big TODO: on the maintab.cpp
about) and I'll fix it tomorrow as it's quite late here and I'm almost
sleeping at the keyboard.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01 21:36:48 -07:00

25 lines
774 B
C++

#ifndef DIVELOCATIONMODEL_H
#define DIVELOCATIONMODEL_H
#include <QAbstractListModel>
#include <stdint.h>
class LocationInformationModel : public QAbstractListModel {
Q_OBJECT
public:
enum { DIVE_SITE_UUID = Qt::UserRole+1};
static LocationInformationModel *instance();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
int32_t addDiveSite(const QString& name, int lat = 0, int lon = 0);
bool setData(const QModelIndex &index, const QVariant &value, int role);
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
public slots:
void update();
private:
LocationInformationModel(QObject *obj = 0);
int internalRowCount;
};
#endif