Now able to load parts of a Recipe into the user interface.
This commit is contained in:
parent
2e42bafae3
commit
e4dcd17e3e
7
main.cpp
7
main.cpp
|
@ -11,12 +11,5 @@ int main(int argc, char *argv[])
|
|||
|
||||
Database db("test.db");
|
||||
|
||||
vector<RecipeIngredient> ri;
|
||||
ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c")));
|
||||
|
||||
|
||||
|
||||
Recipe rec("Example", ri, Instruction("Hello world"), QImage(), vector<RecipeTag>(), QDate::currentDate(), QTime(0, 30), QTime(0, 25), 10.0f);
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,14 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow){
|
||||
ui->setupUi(this);
|
||||
|
||||
//TESTING CODE
|
||||
vector<RecipeIngredient> ri;
|
||||
ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c")));
|
||||
|
||||
Recipe rec("Example", ri, Instruction("<b>BOLD</b><i>iTaLiCs</i>"), QImage(), vector<RecipeTag>(), QDate::currentDate(), QTime(0, 30), QTime(0, 25), 10.0f);
|
||||
|
||||
this->loadFromRecipe(rec);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow(){
|
||||
|
@ -22,9 +30,9 @@ void MainWindow::setRecipeName(string name){
|
|||
}
|
||||
|
||||
void MainWindow::setInstruction(Instruction instruction){
|
||||
|
||||
ui->instructionsTextEdit->setHtml(QString::fromStdString(instruction.getHTML()));
|
||||
}
|
||||
|
||||
void MainWindow::setIngredients(vector<RecipeIngredient> ingredients){
|
||||
|
||||
///TODO: Implement this.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue