FactDev  0.1
billingstablemodel.h
1 #ifndef BILLINGSTABLEMODEL_H
2 #define BILLINGSTABLEMODEL_H
3 
4 #include <QObject>
5 #include <QAbstractTableModel>
6 
7 #include "models/billing.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 BillingsTableModel : 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 Billing &billing);
78 
83  void remove(const int i);
84 
90  Qt::ItemFlags flags(const QModelIndex & index) const ;
91 
96  int count();
97 
102  QList<Billing> getBillings() const;
103 
104 private:
105  QList<Billing> _billings;
106 };
107 }
108 }
109 }
110 #endif // BILLINGSTABLEMODEL_H
The BillingsTableModel class for a Billing table.
Definition: billingstablemodel.h:22
The Billing class : Billing or Quote of a Customer.
Definition: billing.h:28