#ifndef RECIPETABLEMODEL_H #define RECIPETABLEMODEL_H #include #include "model/recipe/recipe.h" class RecipeTableModel : public QAbstractTableModel { public: RecipeTableModel(); RecipeTableModel(vector recipes); //Overridden methods. int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; //Normal methods. void setRecipes(vector recipes); private: vector recipes; }; #endif // RECIPETABLEMODEL_H