##// END OF EJS Templates
Change the event model to a treeview model + update the last version of CatalogueAPI
Change the event model to a treeview model + update the last version of CatalogueAPI

File last commit:

r1149:c352dc0e2afa
r1149:c352dc0e2afa
Show More
CatalogueEventsModel.h
42 lines | 1.6 KiB | text/x-c | CLexer
/ gui / include / Catalogue / CatalogueEventsModel.h
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 #ifndef SCIQLOP_CATALOGUEEVENTSMODEL_H
#define SCIQLOP_CATALOGUEEVENTSMODEL_H
TableModel for events
r1130
#include <Common/spimpl.h>
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 #include <QAbstractItemModel>
TableModel for events
r1130
Adaptation to the shared pointers of catalogue controller
r1143 class DBEvent;
TableModel for events
r1130
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 class CatalogueEventsModel : public QAbstractItemModel {
TableModel for events
r1130 public:
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 CatalogueEventsModel(QObject *parent = nullptr);
TableModel for events
r1130
Adaptation to the shared pointers of catalogue controller
r1143 void setEvents(const QVector<std::shared_ptr<DBEvent> > &events);
std::shared_ptr<DBEvent> getEvent(int row) const;
TableModel for events
r1130
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149
Edition of events from the inspector
r1148 void addEvent(const std::shared_ptr<DBEvent> &event);
void removeEvent(const std::shared_ptr<DBEvent> &event);
void refreshEvent(const std::shared_ptr<DBEvent> &event);
TableModel for events
r1130
// Model
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
TableModel for events
r1130 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;
Drag d'un event sur le TimeWidget
r1133 Qt::DropActions supportedDragActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
TableModel for events
r1130 private:
class CatalogueEventsTableModelPrivate;
spimpl::unique_impl_ptr<CatalogueEventsTableModelPrivate> impl;
};
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 #endif // SCIQLOP_CATALOGUEEVENTSMODEL_H