2017-04-27 18:25:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2016-01-07 08:08:00 +00:00
|
|
|
#ifndef GPSLISTMODEL_H
|
|
|
|
#define GPSLISTMODEL_H
|
|
|
|
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/gpslocation.h"
|
2019-09-27 23:26:54 +00:00
|
|
|
#include <QObject>
|
2016-01-07 08:08:00 +00:00
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
2019-09-27 23:26:54 +00:00
|
|
|
class GpsListModel : public QAbstractListModel
|
2016-01-07 08:08:00 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum GpsListRoles {
|
|
|
|
GpsDateRole = Qt::UserRole + 1,
|
|
|
|
GpsNameRole,
|
|
|
|
GpsLatitudeRole,
|
2016-01-09 07:13:30 +00:00
|
|
|
GpsLongitudeRole,
|
|
|
|
GpsWhenRole
|
2016-01-07 08:08:00 +00:00
|
|
|
};
|
|
|
|
|
2019-09-27 23:26:54 +00:00
|
|
|
static GpsListModel *instance();
|
2016-01-07 08:08:00 +00:00
|
|
|
void clear();
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
QHash<int, QByteArray> roleNames() const;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
2019-09-27 23:26:54 +00:00
|
|
|
void update();
|
2016-01-07 08:08:00 +00:00
|
|
|
private:
|
2019-09-29 08:44:27 +00:00
|
|
|
GpsListModel();
|
2016-01-08 15:11:49 +00:00
|
|
|
QVector<gpsTracker> m_gpsFixes;
|
2016-01-07 08:08:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GPSLISTMODEL_H
|