Files
microanalyzer/tableformat.h
2016-03-14 12:14:39 +01:00

42 lines
1.2 KiB
C++

////////////////////////////////////////////////////////////////////////////////
/**
* \file tableformat.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef TABLEFORMAT_H
#define TABLEFORMAT_H
#include <QAbstractTableModel>
#include <QList>
#include "layerrecord.h"
class TableFormat : public QAbstractTableModel
{
Q_OBJECT
public:
TableFormat(QObject *parent=0);
TableFormat(QList<LayerRecord*> listofPairs, QObject *parent=0);
Qt::ItemFlags flags(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex());
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
QList<LayerRecord*> getList();
private:
QList<LayerRecord*> listOfPairs;
};
#endif // TABLEFORMAT_H