RecipeIngredient::RecipeIngredient(Ingredient *ingredient, Quantity quantity, double minutes, QObject *parent) :
    QObject(parent)
{
    setIngredient(ingredient);
    _quantity = quantity;
    _minutes = minutes;
}
示例#2
0
plat::plat(string _nom, vector<string> _ingredient, int _avis, int _calorie, int _prix, const QString _imagePath){
    setNom(_nom);
    setIngredient(_ingredient);
    setAvis(_avis);
    setCalorie(_calorie);
    setPrix(_prix);
    setImage(_imagePath);
}
RecipeIngredient::RecipeIngredient(Ingredient *ingredient, Quantity quantity, QObject *parent) :
    QObject(parent)
{
    setIngredient(ingredient);
    _quantity = quantity;
    _minutes = 0;
    initialize();
}
void RecipeIngredient::fromXml(QDomElement element)
{
    setIngredient(Ingredient::createIngredient(element.elementsByTagName("Ingredient").at(0).toElement()));
    setQuantity(Quantity(element.elementsByTagName("Quantity").at(0).toElement()));
    setMinutes(element.attribute("minutes", QString().setNum(minutes())).toDouble());
}