RecipeDB/main.cpp

34 lines
944 B
C++
Raw Normal View History

#include "userInterface/mainwindow.h"
2018-02-02 09:00:46 +00:00
#include <QApplication>
2018-02-02 10:41:36 +00:00
2018-02-12 13:24:11 +00:00
#include "model/database/database.h"
#include "model/database/recipedatabase.h"
2018-02-02 09:00:46 +00:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
//TESTING CODE
2018-02-02 10:41:36 +00:00
RecipeDatabase recipeDB("recipes");
//TESTING CODE
// vector<RecipeIngredient> ri;
// ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c")));
// ri.push_back(RecipeIngredient("Baking Powder", "Additives", 1.0f, UnitOfMeasure("Teaspoon", "Teaspoons", "Tsp")));
// Recipe rec("Example", ri, Instruction("<b>BOLD</b><i>iTaLiCs</i>"), QImage(), vector<RecipeTag>(), QDate::currentDate(), QTime(0, 30), QTime(0, 25), 10.0f);
// bool success = recipeDB.storeRecipe(rec);
// printf("Storage successful: %d\n", success);
2018-03-03 07:48:55 +00:00
Recipe reloadRec = recipeDB.retrieveRecipe("Example");
reloadRec.print();
2018-03-03 07:48:55 +00:00
w.loadFromRecipe(reloadRec);
return a.exec();
2018-02-02 09:00:46 +00:00
}