From 6114bdbfa7f6b9d9314743656e9d1b2d2eccb9e4 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Fri, 30 Mar 2018 11:33:08 +0200 Subject: [PATCH] Comments line clears when an ingredient is added. --- gui/newrecipedialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/newrecipedialog.cpp b/gui/newrecipedialog.cpp index a0681f2..5e35cee 100644 --- a/gui/newrecipedialog.cpp +++ b/gui/newrecipedialog.cpp @@ -75,6 +75,7 @@ void NewRecipeDialog::on_addIngredientButton_clicked(){ UnitOfMeasure u = this->units[ui->unitComboBox->currentIndex()]; RecipeIngredient ri(i, ui->quantitySpinBox->value(), u, ui->commentsLineEdit->text().toStdString()); this->ingredientListModel.addIngredient(ri); + ui->commentsLineEdit->clear(); } void NewRecipeDialog::on_italicsButton_clicked(){ @@ -150,6 +151,7 @@ void NewRecipeDialog::on_newIngredientButton_clicked(){ Ingredient i = d.getIngredient(); this->recipeDB->storeIngredient(i); this->populateIngredientsBox(); + ui->ingredientNameBox->setCurrentText(QString::fromStdString(i.getName())); } }