##// END OF EJS Templates
TableModel for events
TableModel for events

File last commit:

r1130:da2e9b24ace3
r1130:da2e9b24ace3
Show More
CatalogueEventsTableModel.h
33 lines | 1.1 KiB | text/x-c | CLexer
/ gui / include / Catalogue / CatalogueEventsTableModel.h
#ifndef SCIQLOP_CATALOGUEEVENTSTABLEMODEL_H
#define SCIQLOP_CATALOGUEEVENTSTABLEMODEL_H
#include <Common/spimpl.h>
#include <QAbstractTableModel>
#include <DBEvent.h>
class CatalogueEventsTableModel : public QAbstractTableModel {
public:
CatalogueEventsTableModel(QObject *parent = nullptr);
void setEvents(const QVector<DBEvent> &events);
DBEvent getEvent(int row) const;
// Model
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
private:
class CatalogueEventsTableModelPrivate;
spimpl::unique_impl_ptr<CatalogueEventsTableModelPrivate> impl;
};
#endif // SCIQLOP_CATALOGUEEVENTSTABLEMODEL_H