FactDev  0.1
projectstablemodel.h
1 #ifndef PROJECTSTABLEMODEL_H
2 #define PROJECTSTABLEMODEL_H
3 
4 #include <QObject>
5 #include <QAbstractTableModel>
6 
7 #include "models/project.h"
8 #include "utils/log.h"
9 
10 using namespace Models;
11 using namespace Utils;
12 
13 namespace Gui {
14 namespace Widgets {
15 namespace WdgModels {
16 
22 class ProjectsTableModel : public QAbstractTableModel
23 {
24 public:
32 
37  int rowCount(const QModelIndex &) const;
38 
43  int columnCount(const QModelIndex &) const;
44 
51  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
52 
60  QVariant headerData(int section, Qt::Orientation orientation,
61  int role = Qt::DisplayRole) const;
62 
70  bool setData(const QModelIndex & index, const QVariant & value,
71  int role = Qt::EditRole);
72 
77  void append(const Project &project);
78 
83  void remove(const int i);
84 
90  Qt::ItemFlags flags(const QModelIndex & index) const ;
91 
96  int count();
97 
102  QList<Project> getProjects() const;
103 
104 private:
105  QList<Project> _projects;
106 };
107 }
108 }
109 }
110 #endif // PROJECTSTABLEMODEL_H
The Project class : Project linked to a Customer.
Definition: project.h:17
The ProjectsTableModel class for a Project table.
Definition: projectstablemodel.h:22