From 4b51029d70e29c26d3b102c9e9b6178b7e1d3b60 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Sat, 31 Mar 2018 22:15:01 +0200 Subject: [PATCH] Fixed unused variable issues. --- RecipeDB.pro | 4 +- gui/mainwindow.ui | 100 +----------------- gui/newDialogs/newfoodgroupdialog.ui | 4 +- gui/newDialogs/newingredientdialog.ui | 8 +- gui/newDialogs/newtagdialog.ui | 6 +- gui/newDialogs/newunitdialog.ui | 9 +- gui/newrecipedialog.ui | 22 ++-- gui/openrecipedialog.ui | 14 ++- main.cpp | 7 +- .../ingredients/ingredientlistmodel.cpp | 1 + .../ingredients/recipeingredientlistmodel.cpp | 1 + model/recipe/tags/taglistmodel.cpp | 1 + res.qrc | 4 + utils/aspectratiopixmaplabel.cpp | 1 + 14 files changed, 45 insertions(+), 137 deletions(-) diff --git a/RecipeDB.pro b/RecipeDB.pro index 9372036..fdcef14 100644 --- a/RecipeDB.pro +++ b/RecipeDB.pro @@ -79,6 +79,4 @@ DISTFILES += \ .gitignore RESOURCES += \ - res.qrc \ - images.qrc \ - images.qrc + res.qrc diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 69bddb9..a220c32 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -26,7 +26,7 @@ RecipeDB - + :/images/images/icon.png:/images/images/icon.png @@ -111,13 +111,6 @@ 80 - - - Noto Sans CJK KR Light - 20 - PreferAntialias - - false @@ -155,13 +148,6 @@ QPushButton#newButton:pressed{ 80 - - - Noto Sans CJK KR Light - 20 - PreferAntialias - - QPushButton#openButton { background-color: rgb(222, 226, 255); @@ -190,13 +176,6 @@ QPushButton#openButton:pressed{ 80 - - - Noto Sans CJK KR Light - 20 - PreferAntialias - - false @@ -234,13 +213,6 @@ QPushButton#editButton:pressed{ 80 - - - Noto Sans CJK KR Light - 20 - PreferAntialias - - false @@ -372,13 +344,6 @@ font: "Noto Sans CJK KR"; 0 - - - Noto Sans CJK KR Light - 14 - PreferAntialias - - By Unknown Author @@ -440,12 +405,6 @@ font: "Noto Sans CJK KR"; - - - Noto Sans CJK KR Light - 12 - - Prep Time: @@ -459,12 +418,6 @@ font: "Noto Sans CJK KR"; true - - - Noto Sans CJK KR Light - 12 - - Cook Time: @@ -475,12 +428,6 @@ font: "Noto Sans CJK KR"; - - - Noto Sans CJK KR Light - 12 - - Servings: @@ -560,12 +507,6 @@ font: "Noto Sans CJK KR"; 40 - - - Noto Sans CJK KR Thin - 18 - - background-color: rgb(194, 196, 233); @@ -585,13 +526,6 @@ font: "Noto Sans CJK KR"; 0 - - - Noto Sans CJK KR Light - 12 - PreferAntialias - - background-color: rgb(232, 232, 232); @@ -671,12 +605,6 @@ font: "Noto Sans CJK KR"; 40 - - - Noto Sans CJK KR Thin - 18 - - background-color: rgb(218, 219, 234); @@ -690,12 +618,6 @@ font: "Noto Sans CJK KR"; - - - Noto Sans CJK KR Medium - PreferAntialias - - background-color: rgb(244, 244, 244); @@ -727,7 +649,7 @@ font: "Noto Sans CJK KR"; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Noto Sans CJK KR Medium'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Liberation Serif Bold'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; color:#00ff40;">This is some </span><span style=" font-family:'MS Shell Dlg 2'; font-size:16pt; color:#a33c3e;">colored text and </span><a href="https://www.google.com"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt; text-decoration: underline; color:#0000ff;">link</span></a></p></body></html> @@ -810,7 +732,7 @@ p, li { white-space: pre-wrap; } - :/images/images/no_image.png + :/images/images/no_image.png false @@ -849,13 +771,6 @@ p, li { white-space: pre-wrap; } - - - Noto Sans CJK KR Light - 16 - PreferAntialias - - Tags @@ -866,13 +781,6 @@ p, li { white-space: pre-wrap; } - - - Noto Sans CJK KR Light - 12 - PreferAntialias - - background-color: rgb(255, 255, 255); @@ -908,7 +816,7 @@ p, li { white-space: pre-wrap; } - + diff --git a/gui/newDialogs/newfoodgroupdialog.ui b/gui/newDialogs/newfoodgroupdialog.ui index bbd72d3..cbe9c53 100644 --- a/gui/newDialogs/newfoodgroupdialog.ui +++ b/gui/newDialogs/newfoodgroupdialog.ui @@ -19,7 +19,7 @@ New Food Group - + :/images/images/icon.png:/images/images/icon.png @@ -62,7 +62,7 @@ - + diff --git a/gui/newDialogs/newingredientdialog.ui b/gui/newDialogs/newingredientdialog.ui index 792e239..30e9aed 100644 --- a/gui/newDialogs/newingredientdialog.ui +++ b/gui/newDialogs/newingredientdialog.ui @@ -14,7 +14,7 @@ New Ingredient - + :/images/images/icon.png:/images/images/icon.png @@ -81,7 +81,7 @@ - + :/images/images/plus_icon.png:/images/images/plus_icon.png @@ -92,7 +92,7 @@ - + :/images/images/minus_icon.png:/images/images/minus_icon.png @@ -119,7 +119,7 @@ - + diff --git a/gui/newDialogs/newtagdialog.ui b/gui/newDialogs/newtagdialog.ui index 72ea9f2..04ac9c6 100644 --- a/gui/newDialogs/newtagdialog.ui +++ b/gui/newDialogs/newtagdialog.ui @@ -14,7 +14,7 @@ New Tag - + :/images/images/icon.png:/images/images/icon.png @@ -31,7 +31,6 @@ - 13 3 false false @@ -49,7 +48,6 @@ - 12 3 false false @@ -73,7 +71,7 @@ - + diff --git a/gui/newDialogs/newunitdialog.ui b/gui/newDialogs/newunitdialog.ui index 92fc161..443ffc3 100644 --- a/gui/newDialogs/newunitdialog.ui +++ b/gui/newDialogs/newunitdialog.ui @@ -14,7 +14,7 @@ New Unit - + :/images/images/icon.png:/images/images/icon.png @@ -31,7 +31,6 @@ - 12 3 false false @@ -52,7 +51,6 @@ - 12 3 false false @@ -73,7 +71,6 @@ - 12 3 false false @@ -115,7 +112,6 @@ - 12 3 false false @@ -146,7 +142,6 @@ - 12 3 false false @@ -189,7 +184,7 @@ - + diff --git a/gui/newrecipedialog.ui b/gui/newrecipedialog.ui index 50bee64..56ab137 100644 --- a/gui/newrecipedialog.ui +++ b/gui/newrecipedialog.ui @@ -23,7 +23,7 @@ New Recipe - + :/images/images/icon.png:/images/images/icon.png @@ -103,7 +103,6 @@ - 14 3 false false @@ -127,7 +126,6 @@ - 12 3 false false @@ -175,7 +173,7 @@ 0 1999 12 - 22 + 21 @@ -326,7 +324,7 @@ background-color: rgb(255, 255, 255); - + :/images/images/plus_icon.png:/images/images/plus_icon.png @@ -340,7 +338,7 @@ background-color: rgb(255, 255, 255); - + :/images/images/minus_icon.png:/images/images/minus_icon.png @@ -578,7 +576,7 @@ QPushButton#deleteTagButton:pressed{ Create a new ingredient - + :/images/images/plus_icon.png:/images/images/plus_icon.png @@ -592,7 +590,7 @@ QPushButton#deleteTagButton:pressed{ - + :/images/images/minus_icon.png:/images/images/minus_icon.png @@ -676,7 +674,7 @@ QPushButton#deleteTagButton:pressed{ Create a new unit of measure - + :/images/images/plus_icon.png:/images/images/plus_icon.png @@ -690,7 +688,7 @@ QPushButton#deleteTagButton:pressed{ - + :/images/images/minus_icon.png:/images/images/minus_icon.png @@ -864,7 +862,7 @@ QPushButton#removeIngredientButton:pressed{ - :/images/images/no_image.png + :/images/images/no_image.png false @@ -990,7 +988,7 @@ QPushButton#removeIngredientButton:pressed{ - + diff --git a/gui/openrecipedialog.ui b/gui/openrecipedialog.ui index 06db1f0..a9b407f 100644 --- a/gui/openrecipedialog.ui +++ b/gui/openrecipedialog.ui @@ -14,7 +14,7 @@ Open Recipe - + :/images/images/icon.png:/images/images/icon.png @@ -67,7 +67,7 @@ - + :/images/images/tag.png:/images/images/tag.png @@ -121,7 +121,7 @@ - + :/images/images/ingredients.png:/images/images/ingredients.png @@ -175,7 +175,7 @@ - + :/images/images/foodPyramid.png:/images/images/foodPyramid.png @@ -237,7 +237,6 @@ - 12 3 false false @@ -315,7 +314,7 @@ QPushButton#deleteRecipeButton:pressed{ - + :/images/images/trash.png:/images/images/trash.png @@ -370,7 +369,6 @@ QPushButton#exitButton:pressed{ - 14 3 false false @@ -411,7 +409,7 @@ QPushButton#exitButton:pressed{ - + diff --git a/main.cpp b/main.cpp index 6a00644..00a49af 100644 --- a/main.cpp +++ b/main.cpp @@ -41,7 +41,9 @@ Recipe checkForFirstRun(RecipeDatabase *recipeDB){ } void loadAndSetFonts(){ - QFontDatabase:: + int id = QFontDatabase::addApplicationFont(":/fonts/NotoSans-Light.ttf"); + QString family = QFontDatabase::applicationFontFamilies(id).at(0); + printf("%s\n", family.toStdString().c_str()); } int main(int argc, char *argv[]) @@ -49,6 +51,9 @@ int main(int argc, char *argv[]) RecipeDatabase recipeDB(QString(FileUtils::appDataPath+"recipes.db").toStdString()); QApplication a(argc, argv); + + loadAndSetFonts(); + MainWindow w(&recipeDB); w.loadFromRecipe(checkForFirstRun(&recipeDB)); w.show(); diff --git a/model/recipe/ingredients/ingredientlistmodel.cpp b/model/recipe/ingredients/ingredientlistmodel.cpp index 054a4d4..bbafe66 100644 --- a/model/recipe/ingredients/ingredientlistmodel.cpp +++ b/model/recipe/ingredients/ingredientlistmodel.cpp @@ -5,6 +5,7 @@ IngredientListModel::IngredientListModel(){ } int IngredientListModel::rowCount(const QModelIndex &parent) const{ + Q_UNUSED(parent); return this->ingredients.size(); } diff --git a/model/recipe/ingredients/recipeingredientlistmodel.cpp b/model/recipe/ingredients/recipeingredientlistmodel.cpp index 26e98fd..18cdaa6 100644 --- a/model/recipe/ingredients/recipeingredientlistmodel.cpp +++ b/model/recipe/ingredients/recipeingredientlistmodel.cpp @@ -5,6 +5,7 @@ RecipeIngredientListModel::RecipeIngredientListModel(){ } int RecipeIngredientListModel::rowCount(const QModelIndex &parent) const{ + Q_UNUSED(parent); return this->ingredients.size(); } diff --git a/model/recipe/tags/taglistmodel.cpp b/model/recipe/tags/taglistmodel.cpp index 149ad3e..4ce77c8 100644 --- a/model/recipe/tags/taglistmodel.cpp +++ b/model/recipe/tags/taglistmodel.cpp @@ -5,6 +5,7 @@ TagListModel::TagListModel(){ } int TagListModel::rowCount(const QModelIndex &parent) const{ + Q_UNUSED(parent); return this->tags.size(); } diff --git a/res.qrc b/res.qrc index de44dca..255f2a7 100644 --- a/res.qrc +++ b/res.qrc @@ -10,4 +10,8 @@ images/foodPyramid.png images/ingredients.png + + fonts/NotoSans-Light.ttf + fonts/NotoSans-LightItalic.ttf + diff --git a/utils/aspectratiopixmaplabel.cpp b/utils/aspectratiopixmaplabel.cpp index 9347b8e..6a2b9cf 100644 --- a/utils/aspectratiopixmaplabel.cpp +++ b/utils/aspectratiopixmaplabel.cpp @@ -31,6 +31,7 @@ QPixmap AspectRatioPixmapLabel::scaledPixmap() const void AspectRatioPixmapLabel::resizeEvent(QResizeEvent * e) { + Q_UNUSED(e); if(!pix.isNull()) QLabel::setPixmap(scaledPixmap()); }