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