First ability to create recipe in gui #5
|
@ -241,40 +241,181 @@ QPushButton#browseButton:pressed{
|
|||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QLabel" name="recipeNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="basicInfoPanel" native="true">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
<pointsize>24</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>false</italic>
|
||||
<bold>false</bold>
|
||||
<stylestrategy>PreferAntialias</stylestrategy>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(219, 216, 216);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Recipe Name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<string notr="true">background-color: rgb(219, 216, 216);
|
||||
font: "Noto Sans CJK KR";</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignLeft">
|
||||
<widget class="QWidget" name="basicInfoSubPanel" native="true">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
</font>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QWidget" name="prepTimePanel" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="prepTimeLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Prep Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="cookTimePanel" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="cookTimeLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cook Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="servingsPanel" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="servingsLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Servings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="recipeNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans CJK KR Light</family>
|
||||
<pointsize>30</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>false</italic>
|
||||
<bold>false</bold>
|
||||
<stylestrategy>PreferAntialias</stylestrategy>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Recipe Name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -417,6 +558,12 @@ QPushButton#browseButton:pressed{
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -48,5 +48,7 @@ int main(int argc, char *argv[])
|
|||
// printf("Accepted the dialog.\n");
|
||||
// }
|
||||
|
||||
w.loadFromRecipe(recipeDB.retrieveRecipe("Generic Bread"));
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,9 @@ void MainWindow::loadFromRecipe(Recipe recipe){
|
|||
setInstruction(recipe.getInstruction());
|
||||
setIngredients(recipe.getIngredients());
|
||||
setImage(recipe.getImage());
|
||||
setPrepTime(recipe.getPrepTime());
|
||||
setCookTime(recipe.getCookTime());
|
||||
setServings(recipe.getServings());
|
||||
}
|
||||
|
||||
void MainWindow::setRecipeName(string name){
|
||||
|
@ -40,6 +43,18 @@ void MainWindow::setImage(QImage img){
|
|||
ui->imageLabel->setPixmap(QPixmap::fromImage(img));
|
||||
}
|
||||
|
||||
void MainWindow::setPrepTime(QTime prepTime){
|
||||
ui->prepTimeLabel->setText(QString("Prep Time: ")+prepTime.toString("hh:mm:ss"));
|
||||
}
|
||||
|
||||
void MainWindow::setCookTime(QTime cookTime){
|
||||
ui->cookTimeLabel->setText(QString("Cook Time: ")+cookTime.toString("hh:mm:ss"));
|
||||
}
|
||||
|
||||
void MainWindow::setServings(float servings){
|
||||
ui->servingsLabel->setText(QString("Servings: ")+QString::fromStdString(toString(servings)));
|
||||
}
|
||||
|
||||
void MainWindow::on_newButton_clicked(){
|
||||
NewRecipeDialog d(this->recipeDB, this);
|
||||
d.show();
|
||||
|
|
|
@ -39,6 +39,9 @@ public:
|
|||
void setInstruction(Instruction instruction);
|
||||
void setIngredients(vector<RecipeIngredient> ingredients);
|
||||
void setImage(QImage img);
|
||||
void setPrepTime(QTime prepTime);
|
||||
void setCookTime(QTime cookTime);
|
||||
void setServings(float servings);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
Loading…
Reference in New Issue