subsurface/qt-models/gpslistmodel.h
Dirk Hohndel 7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00

34 lines
743 B
C++

#ifndef GPSLISTMODEL_H
#define GPSLISTMODEL_H
#include "core/gpslocation.h"
#include <QObject>
#include <QAbstractListModel>
class GpsListModel : public QAbstractListModel
{
Q_OBJECT
public:
enum GpsListRoles {
GpsDateRole = Qt::UserRole + 1,
GpsNameRole,
GpsLatitudeRole,
GpsLongitudeRole,
GpsWhenRole
};
static GpsListModel *instance();
GpsListModel(QObject *parent = 0);
void addGpsFix(gpsTracker g);
void clear();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QHash<int, QByteArray> roleNames() const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
void update();
private:
QVector<gpsTracker> m_gpsFixes;
static GpsListModel *m_instance;
};
#endif // GPSLISTMODEL_H