2017-04-27 18:25:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
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
|
|
|
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/metrics.h"
|
2014-10-15 13:30:50 +00:00
|
|
|
|
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
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
2018-09-29 20:13:44 +00:00
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2013-11-14 19:39:35 +00:00
|
|
|
void repopulate();
|
|
|
|
};
|
|
|
|
|
2018-05-08 15:26:48 +00:00
|
|
|
class DiveTypeSelectionModel : public QStringListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
2018-09-29 20:13:44 +00:00
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
2018-05-08 15:26:48 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
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();
|
2018-09-29 20:13:44 +00:00
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
2014-02-28 04:09:57 +00:00
|
|
|
|
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
|