#ifndef INGREDIENTLISTMODEL_H #define INGREDIENTLISTMODEL_H #include #include #include #include "model/recipe/ingredients/ingredient.h" class IngredientListModel : public QAbstractListModel { public: IngredientListModel(); //Overridden methods. int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; //Custom methods to handle ingredient data. void setIngredients(vector ingredients); bool addIngredient(Ingredient i); void deleteIngredient(int index); vector getIngredients(); private: vector ingredients; //Helper for printing. }; #endif // INGREDIENTLISTMODEL_H