2013-04-13 20:44:02 -07:00
|
|
|
/*
|
|
|
|
* models.h
|
|
|
|
*
|
|
|
|
* header file for the equipment models of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2013-04-13 10:17:59 -03:00
|
|
|
#ifndef MODELS_H
|
|
|
|
#define MODELS_H
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
2013-05-23 15:33:20 -03:00
|
|
|
#include <QStringList>
|
2013-11-14 17:39:35 -02:00
|
|
|
#include <QStringListModel>
|
2014-09-17 16:18:37 -03:00
|
|
|
#include <QSortFilterProxyModel>
|
2015-05-28 16:23:49 -03:00
|
|
|
#include <QPixmap>
|
2013-05-01 23:51:34 -03:00
|
|
|
|
2014-10-15 15:30:50 +02:00
|
|
|
#include "metrics.h"
|
|
|
|
|
2013-04-13 10:17:59 -03:00
|
|
|
#include "../dive.h"
|
2013-04-27 12:27:27 -03:00
|
|
|
#include "../divelist.h"
|
2014-05-12 13:53:26 -03:00
|
|
|
#include "../divecomputer.h"
|
2015-05-28 15:00:58 -03:00
|
|
|
#include "cleanertablemodel.h"
|
2015-05-28 18:02:06 -03:00
|
|
|
#include "treemodel.h"
|
2013-04-21 22:12:36 -03:00
|
|
|
|
2014-02-27 20:09:57 -08:00
|
|
|
class GasSelectionModel : public QStringListModel {
|
2013-11-14 17:39:35 -02:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-27 20:09:57 -08:00
|
|
|
static GasSelectionModel *instance();
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
|
|
|
virtual QVariant data(const QModelIndex &index, int role) const;
|
|
|
|
public
|
|
|
|
slots:
|
2013-11-14 17:39:35 -02:00
|
|
|
void repopulate();
|
|
|
|
};
|
|
|
|
|
2013-12-06 14:29:38 -02:00
|
|
|
|
|
|
|
class LanguageModel : public QAbstractListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-27 20:09:57 -08:00
|
|
|
static LanguageModel *instance();
|
|
|
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
|
|
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
2013-12-06 14:29:38 -02:00
|
|
|
private:
|
2014-02-27 20:09:57 -08:00
|
|
|
LanguageModel(QObject *parent = 0);
|
2013-12-06 14:29:38 -02:00
|
|
|
|
|
|
|
QStringList languages;
|
|
|
|
};
|
2014-09-17 15:45:18 -03:00
|
|
|
|
2014-02-11 19:14:46 +01:00
|
|
|
#endif // MODELS_H
|