subsurface/qt-models/models.h
Berthold Stoeger d4282e2689 Icons: cache small edit icon
In analogy to the trash-icons, cache a small rendered version of
the edit icon. This will be used in the dive-site table. Rename
the icon alias from "duplicate-edit-icon" to "edit-icon", as
it actually is not a duplicated. The other "edit" icon is an
"undo" icon!

Move the accessor functions to cleanertablemode.cpp. This is not
the ideal place, but since the functions are declared in
cleanertablemodel.h it's certainly better than the old place
(models.cpp)!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12 18:19:07 +03:00

60 lines
1.3 KiB
C++

// SPDX-License-Identifier: GPL-2.0
/*
* models.h
*
* header file for the equipment models of Subsurface
*
*/
#ifndef MODELS_H
#define MODELS_H
#include <QAbstractTableModel>
#include <QStringList>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QPixmap>
#include "core/metrics.h"
#include "core/dive.h"
#include "core/divelist.h"
#include "core/divecomputer.h"
#include "cleanertablemodel.h"
#include "treemodel.h"
class GasSelectionModel : public QStringListModel {
Q_OBJECT
public:
static GasSelectionModel *instance();
Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant data(const QModelIndex &index, int role) const override;
public
slots:
void repopulate();
};
class DiveTypeSelectionModel : public QStringListModel {
Q_OBJECT
public:
static DiveTypeSelectionModel *instance();
Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant data(const QModelIndex &index, int role) const override;
public
slots:
void repopulate();
};
class LanguageModel : public QAbstractListModel {
Q_OBJECT
public:
static LanguageModel *instance();
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
private:
LanguageModel(QObject *parent = 0);
QStringList languages;
};
#endif // MODELS_H