Aller à la documentation de ce fichier.00001 #ifndef INVENTORYTABLEMODEL_H
00002 #define INVENTORYTABLEMODEL_H
00003
00004 #include <QAbstractTableModel>
00005 #include <QStringList>
00006
00007 class InventoryTableModel : public QAbstractTableModel
00008 {
00009 Q_OBJECT
00010 public:
00011
00012 explicit InventoryTableModel(QStringList *tableData, int column = 4, QObject *parent=0);
00013 ~InventoryTableModel();
00014
00015 int rowCount(const QModelIndex &parent) const;
00016 int columnCount(const QModelIndex &parent) const;
00017 int rowCount() const;
00018 int columnCount() const;
00019 QVariant data(const QModelIndex &index, int role) const;
00020 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
00021 Qt::ItemFlags flags(const QModelIndex &index) const;
00022 bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);
00023 bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex());
00024 bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
00025 QList< QPair< QString, bool> > getList();
00026
00027 private:
00028
00029 QList< QPair< QString, bool> > *m_tableData;
00030 int m_column;
00031
00032 };
00033
00034 #endif // INVENTORYTABLEMODEL_H