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.
42 lines
1.2 KiB
42 lines
1.2 KiB
////////////////////////////////////////////////////////////////////////////////
|
|
/**
|
|
* \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
|