From 81c15f84b94086110caa1a73b2509958a849bb74 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Fri, 7 Feb 2020 16:47:12 +0100 Subject: [PATCH] removed some warnings --- src/IntelliHelper/IntelliTriangulation.cpp | 2 +- src/Layer/PaintingArea.cpp | 16 +++++++++------- src/Layer/PaintingArea.h | 14 +++++++------- src/Tool/IntelliTool.cpp | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/IntelliHelper/IntelliTriangulation.cpp b/src/IntelliHelper/IntelliTriangulation.cpp index 2c0d56c..b22b805 100644 --- a/src/IntelliHelper/IntelliTriangulation.cpp +++ b/src/IntelliHelper/IntelliTriangulation.cpp @@ -88,7 +88,7 @@ std::vector IntelliTriangulation::calculateTriangles(std::vector(getPrev(post, Vertices.size())); prev = prevalpha = layer.alpha; } -PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent) +PaintingArea::PaintingArea(int newMaxWidth, int newMaxHeight, QWidget*parent) : QLabel(parent){ this->Tool = nullptr; - this->setCanvasDimensions(maxWidth, maxHeight); + this->setCanvasDimensions(newMaxWidth, newMaxHeight); activeLayer = -1; } @@ -69,10 +69,10 @@ bool PaintingArea::getRenderSettings(){ return this->renderSettings.isFastRenderering(); } -void PaintingArea::setCanvasDimensions(int maxWidth, int maxHeight){ +void PaintingArea::setCanvasDimensions(int newMaxWidth, int newMaxHeight){ //set standart parameter - this->maxWidth = maxWidth; - this->maxHeight = maxHeight; + this->maxWidth = newMaxWidth; + this->maxHeight = newMaxHeight; Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32); this->offsetXDimension = maxWidth / 2; @@ -453,12 +453,14 @@ IntelliTool* PaintingArea::copyActiveTool(){ switch(Tool->getTooltype()) { case IntelliTool::Tooltype::CIRCLE: return new IntelliToolCircle(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::FLOODFILL: return new IntelliToolFloodFill(this,&colorPicker, &Toolsettings); + case IntelliTool::Tooltype::GRADIENT: return new IntelliToolGradient(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::LINE: return new IntelliToolLine(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::PEN: return new IntelliToolPen(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::PLAIN: return new IntelliToolPlainTool(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::POLYGON: return new IntelliToolPolygon(this,&colorPicker, &Toolsettings); case IntelliTool::Tooltype::RECTANGLE: return new IntelliToolRectangle(this,&colorPicker, &Toolsettings); - default: return nullptr; + case IntelliTool::Tooltype::NONE: return nullptr; + default: return nullptr; } } @@ -526,7 +528,7 @@ void PaintingArea::historyGoBack(){ void PaintingArea::historyGoForward(){ historyPresent++; if(historyPresent>=static_cast(history.size())){ - historyPresent=history.size()-1; + historyPresent=static_cast(history.size()-1); } layerBundle = history[static_cast(historyPresent)]; this->guiReference->UpdateGui(); diff --git a/src/Layer/PaintingArea.h b/src/Layer/PaintingArea.h index 2bc1746..5dc8793 100644 --- a/src/Layer/PaintingArea.h +++ b/src/Layer/PaintingArea.h @@ -66,11 +66,11 @@ friend IntelliPhotoGui; public: /*! * \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment - * \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px) - * \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px) + * \param newMaxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px) + * \param newMaxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px) * \param parent - The parent window of the main window (default=nullptr) */ -PaintingArea(int maxWidth = 600, int maxHeight = 600, QWidget*parent = nullptr); +PaintingArea(int newMaxWidth = 600, int newMaxHeight = 600, QWidget*parent = nullptr); /*! * \brief This deconstructor is used to clear up the memory and remove the currently active window @@ -85,7 +85,7 @@ void setRenderSettings(bool isFastRenderingOn); /*! * \brief getRenderSettings updates all Images to the new Rendersetting. - * \param isFastRenderingOn is the new given flag for the FastRenderer. + * \return Returns if the flag for the FastRendererin is enabled. */ bool getRenderSettings(); @@ -302,10 +302,10 @@ void historyGoForward(); /*! * \brief setCanvasDimensions sets the dimension of the Canvas - * \param maxWidth - the width of the Canvas. - * \param maxHeight - the height of the Canvas. + * \param newMaxWidth - the width of the Canvas. + * \param newMaxHeight - the height of the Canvas. */ -void setCanvasDimensions(int maxWidth, int maxHeight); +void setCanvasDimensions(int newMaxWidth, int newMaxHeight); /*! * \brief drawPixelOntoActive draws a pixel onto the image data of the active Layer. diff --git a/src/Tool/IntelliTool.cpp b/src/Tool/IntelliTool.cpp index 2c4fd00..f3c2a1b 100644 --- a/src/Tool/IntelliTool.cpp +++ b/src/Tool/IntelliTool.cpp @@ -57,8 +57,8 @@ void IntelliTool::onWheelScrolled(int value){ bool IntelliTool::createToolLayer(){ if(Area->createTempTopLayer(Area->activeLayer)) { - this->activeLayer = &Area->layerBundle[static_cast(Area->activeLayer)]; - this->Canvas = &Area->layerBundle[static_cast(Area->activeLayer + 1)]; + this->activeLayer = &Area->layerBundle[static_cast(Area->activeLayer)]; + this->Canvas = &Area->layerBundle[static_cast(Area->activeLayer + 1)]; return true; } return false;