You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
#ifndef TRENDTABLEMODEL_H
|
|
#define TRENDTABLEMODEL_H
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
class TrendTableModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TrendTableModel(QObject *parent = nullptr);
|
|
|
|
// Header:
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
|
|
int role = Qt::EditRole) override;
|
|
// Basic functionality:
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
void setColumnCount(int count){m_nColumnCount = count;}
|
|
|
|
void addData(int row,int column,QString data);
|
|
private:
|
|
QMap<int,QString> headerDatas;
|
|
QList<QList<QString> > m_datas;
|
|
QList<QString> m_headers;
|
|
int m_nColumnCount = 0;
|
|
};
|
|
|
|
#endif // TRENDTABLEMODEL_H
|