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 explicit InventoryTableModel(QList< QPair< QString, bool> > &tableData, int column = 4, QObject *parent=0);
00014 ~InventoryTableModel();
00015
00016 int rowCount(const QModelIndex &parent) const;
00017 int columnCount(const QModelIndex &parent) const;
00018 int rowCount() const;
00019 int columnCount() const;
00020 QVariant data(const QModelIndex &index, int role) const;
00021 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
00022 Qt::ItemFlags flags(const QModelIndex &index) const;
00023 bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);
00024 bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex());
00025 bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
00026 QList< QPair< QString, bool> > getList();
00027 QStringList getListNew();
00028
00029 private:
00030
00031 QList< QPair< QString, bool> > *m_tableData;
00032 int m_column;
00033
00034 };
00035
00036 #endif // INVENTORYTABLEMODEL_H