##// END OF EJS Templates
More GUI tests refactoring, this will allow more complex tests and ease sync graph tests...
More GUI tests refactoring, this will allow more complex tests and ease sync graph tests Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1308:c5e93e891fc6
r1370:c3077e0c31af
Show More
CatalogueEventsModel.h
70 lines | 2.8 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>
"Apply" and "cancel" buttons on an event
r1162 #include <QLoggingCategory>
#include <unordered_set>
TableModel for events
r1130
Move event in catalogue with Drag&Drop
r1308 class DBCatalogue;
Adaptation to the shared pointers of catalogue controller
r1143 class DBEvent;
Edition of event products via the inspector
r1150 class DBEventProduct;
TableModel for events
r1130
"Apply" and "cancel" buttons on an event
r1162 Q_DECLARE_LOGGING_CATEGORY(LOG_CatalogueEventsModel)
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 class CatalogueEventsModel : public QAbstractItemModel {
"Apply" and "cancel" buttons on an event
r1162 Q_OBJECT
signals:
void modelSorted();
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
"Apply" and "cancel" buttons on an event
r1162 enum class Column { Name, TStart, TEnd, Tags, Product, Validation, NbColumn };
Move event in catalogue with Drag&Drop
r1308 void setSourceCatalogues(const QVector<std::shared_ptr<DBCatalogue> > &catalogues);
Adaptation to the shared pointers of catalogue controller
r1143 void setEvents(const QVector<std::shared_ptr<DBEvent> > &events);
Edition of events from the inspector
r1148 void addEvent(const std::shared_ptr<DBEvent> &event);
void removeEvent(const std::shared_ptr<DBEvent> &event);
"Apply" and "cancel" buttons on an event
r1162 QVector<std::shared_ptr<DBEvent> > events() const;
Edition of events from the inspector
r1148
Edition of event products via the inspector
r1150 enum class ItemType { Root, Event, EventProduct };
ItemType itemTypeOf(const QModelIndex &index) const;
std::shared_ptr<DBEvent> getEvent(const QModelIndex &index) const;
std::shared_ptr<DBEvent> getParentEvent(const QModelIndex &index) const;
std::shared_ptr<DBEventProduct> getEventProduct(const QModelIndex &index) const;
"Apply" and "cancel" buttons on an event
r1162 /// Refresh the data for the specified event
fix refresh of events after a discard
r1245 void refreshEvent(const std::shared_ptr<DBEvent> &event, bool refreshEventProducts = false);
TableModel for events
r1130
"Apply" and "cancel" buttons on an event
r1162 /// Returns a QModelIndex which represent the specified event
QModelIndex indexOf(const std::shared_ptr<DBEvent> &event) const;
/// Marks a change flag on the specified event to allow sorting on the validation column
void setEventHasChanges(const std::shared_ptr<DBEvent> &event, bool hasChanges);
/// Returns true if the specified event has unsaved changes
bool eventsHasChanges(const std::shared_ptr<DBEvent> &event) const;
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:
Edition of event products via the inspector
r1150 class CatalogueEventsModelPrivate;
spimpl::unique_impl_ptr<CatalogueEventsModelPrivate> impl;
TableModel for events
r1130 };
Change the event model to a treeview model + update the last version of CatalogueAPI
r1149 #endif // SCIQLOP_CATALOGUEEVENTSMODEL_H