2018-02-12 13:24:11 +00:00
|
|
|
#ifndef INGREDIENTLISTMODEL_H
|
|
|
|
#define INGREDIENTLISTMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
2018-02-13 08:48:57 +00:00
|
|
|
#include "model/recipe/ingredients/recipeingredient.h"
|
2018-02-12 13:24:11 +00:00
|
|
|
|
|
|
|
class IngredientListModel : public QAbstractListModel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IngredientListModel();
|
|
|
|
|
|
|
|
//Overridden methods.
|
2018-02-13 08:48:57 +00:00
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
2018-02-12 13:24:11 +00:00
|
|
|
|
|
|
|
//Custom methods to handle ingredient data.
|
2018-02-13 08:48:57 +00:00
|
|
|
void setIngredients(vector<RecipeIngredient> ingredients);
|
2018-02-12 13:24:11 +00:00
|
|
|
|
|
|
|
private:
|
2018-02-13 08:48:57 +00:00
|
|
|
vector<RecipeIngredient> ingredients;
|
2018-02-12 13:24:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INGREDIENTLISTMODEL_H
|