Minor Code Style Update + Documentation Spelling Fix

This commit is contained in:
2019-12-19 12:03:21 +01:00
parent 9db5304edc
commit 2da9e15d36
9 changed files with 51 additions and 60 deletions

View File

@@ -69,7 +69,7 @@ void IntelliPhotoGui::slotCreateNewLayer(){
// Stores button value // Stores button value
bool ok1, ok2; bool ok1, ok2;
// tr("New Layer") is the title // "New Layer" is the title of the window
// the next tr is the text to display // the next tr is the text to display
// Define the standard Value, min, max, step and ok button // Define the standard Value, min, max, step and ok button
int width = QInputDialog::getInt(this, tr("New Layer"), int width = QInputDialog::getInt(this, tr("New Layer"),
@@ -91,7 +91,7 @@ void IntelliPhotoGui::slotDeleteLayer(){
// Stores button value // Stores button value
bool ok; bool ok;
// tr("delete Layer") is the title // "delete Layer" is the title of the window
// the next tr is the text to display // the next tr is the text to display
// Define the standard Value, min, max, step and ok button // Define the standard Value, min, max, step and ok button
int layerNumber = QInputDialog::getInt(this, tr("delete Layer"), int layerNumber = QInputDialog::getInt(this, tr("delete Layer"),
@@ -114,13 +114,13 @@ void IntelliPhotoGui::slotSetActiveAlpha(){
// Stores button value // Stores button value
bool ok1, ok2; bool ok1, ok2;
// tr("Layer to set on") is the title // "Layer to set on" is the title of the window
// the next tr is the text to display // the next tr is the text to display
// Define the standard Value, min, max, step and ok button // Define the standard Value, min, max, step and ok button
int layer = QInputDialog::getInt(this, tr("Layer to set on"), int layer = QInputDialog::getInt(this, tr("Layer to set on"),
tr("Layer:"), tr("Layer:"),
-1,-1,100,1, &ok1); -1,-1,100,1, &ok1);
// tr("New Alpha") is the title // "New Alpha" is the title of the window
int alpha = QInputDialog::getInt(this, tr("New Alpha"), int alpha = QInputDialog::getInt(this, tr("New Alpha"),
tr("Alpha:"), tr("Alpha:"),
255,0, 255, 1, &ok2); 255,0, 255, 1, &ok2);
@@ -164,21 +164,21 @@ void IntelliPhotoGui::slotClearActiveLayer(){
// Stores button value // Stores button value
bool ok1, ok2, ok3, ok4; bool ok1, ok2, ok3, ok4;
// tr("Red Input") is the title // "Red Input" is the title of the window
// the next tr is the text to display // the next tr is the text to display
// Define the standard Value, min, max, step and ok button // Define the standard Value, min, max, step and ok button
int red = QInputDialog::getInt(this, tr("Red Input"), int red = QInputDialog::getInt(this, tr("Red Input"),
tr("Red:"), tr("Red:"),
255,0, 255,1, &ok1); 255,0, 255,1, &ok1);
// tr("Green Input") is the title // "Green Input" is the title of the window
int green = QInputDialog::getInt(this, tr("Green Input"), int green = QInputDialog::getInt(this, tr("Green Input"),
tr("Green:"), tr("Green:"),
255,0, 255, 1, &ok2); 255,0, 255, 1, &ok2);
// tr("Blue Input") is the title // "Blue Input" is the title of the window
int blue = QInputDialog::getInt(this, tr("Blue Input"), int blue = QInputDialog::getInt(this, tr("Blue Input"),
tr("Blue:"), tr("Blue:"),
255,0, 255, 1, &ok3); 255,0, 255, 1, &ok3);
// tr("Alpha Input") is the title // "Alpha Input" is the title of the window
int alpha = QInputDialog::getInt(this, tr("Alpha Input"), int alpha = QInputDialog::getInt(this, tr("Alpha Input"),
tr("Alpha:"), tr("Alpha:"),
255,0, 255, 1, &ok4); 255,0, 255, 1, &ok4);
@@ -192,7 +192,7 @@ void IntelliPhotoGui::slotSetActiveLayer(){
// Stores button value // Stores button value
bool ok1; bool ok1;
// tr("Layer to set on") is the title // "Layer to set on" is the title of the window
// the next tr is the text to display // the next tr is the text to display
// Define the standard Value, min, max, step and ok button // Define the standard Value, min, max, step and ok button
int layer = QInputDialog::getInt(this, tr("Layer to set on"), int layer = QInputDialog::getInt(this, tr("Layer to set on"),
@@ -418,7 +418,7 @@ void IntelliPhotoGui::createGui(){
void IntelliPhotoGui::setIntelliStyle(){ void IntelliPhotoGui::setIntelliStyle(){
// Set the title // Set the title
setWindowTitle("IntelliPhoto Prototype"); setWindowTitle("IntelliPhoto Prototype");
//set style sheet // Set style sheet
this->setStyleSheet("background-color:rgb(64,64,64)"); this->setStyleSheet("background-color:rgb(64,64,64)");
this->centralGuiWidget->setStyleSheet("color:rgb(255,255,255)"); this->centralGuiWidget->setStyleSheet("color:rgb(255,255,255)");
this->menuBar()->setStyleSheet("color:rgb(255,255,255)"); this->menuBar()->setStyleSheet("color:rgb(255,255,255)");
@@ -431,7 +431,7 @@ bool IntelliPhotoGui::maybeSave(){
if (false) { if (false) {
QMessageBox::StandardButton ret; QMessageBox::StandardButton ret;
// Painting is the title // Painting is the title of the window
// Add text and the buttons // Add text and the buttons
ret = QMessageBox::warning(this, tr("Painting"), ret = QMessageBox::warning(this, tr("Painting"),
tr("The image has been modified.\n" tr("The image has been modified.\n"

View File

@@ -87,7 +87,6 @@ private:
QMenu *helpMenu; QMenu *helpMenu;
// All the actions that can occur // All the actions that can occur
// meta image actions (need further modularisation) // meta image actions (need further modularisation)
QAction *actionOpen; QAction *actionOpen;
QAction *actionExit; QAction *actionExit;
@@ -124,7 +123,6 @@ private:
// main GUI elements // main GUI elements
QWidget* centralGuiWidget; QWidget* centralGuiWidget;
QGridLayout *mainLayout; QGridLayout *mainLayout;
}; };
#endif #endif

View File

@@ -71,7 +71,6 @@ void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& co
// Draw a line from the last registered point to the current // Draw a line from the last registered point to the current
painter.drawLine(p1, p2); painter.drawLine(p1, p2);
} }
void IntelliImage::drawPlain(const QColor& color){ void IntelliImage::drawPlain(const QColor& color){

View File

@@ -11,7 +11,7 @@
class IntelliColorPicker{ class IntelliColorPicker{
public: public:
/*! /*!
* \brief IntelliColorPicker construktor, setting 2 preset colors, be careful, theese color may change in production. * \brief IntelliColorPicker constructor, setting 2 preset colors, be careful, theese color may change in production.
*/ */
IntelliColorPicker(); IntelliColorPicker();

View File

@@ -108,7 +108,6 @@ std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> poly
Vertices[static_cast<size_t>(prevOfPost)].vertex, Vertices[static_cast<size_t>(prevOfPost)].vertex,
Vertices[static_cast<size_t>(postOfPost)].vertex); Vertices[static_cast<size_t>(postOfPost)].vertex);
Vertices[static_cast<size_t>(post)].isTip = isTip(Vertices[static_cast<size_t>(post)].interiorAngle); Vertices[static_cast<size_t>(post)].isTip = isTip(Vertices[static_cast<size_t>(post)].interiorAngle);
} }
return Triangles; return Triangles;
} }

View File

@@ -11,7 +11,6 @@ struct Triangle{
QPoint A,B,C; QPoint A,B,C;
}; };
namespace IntelliHelper { namespace IntelliHelper {
/*! /*!
@@ -59,7 +58,6 @@ namespace IntelliHelper {
* \return Returns true if the point lies in the üpolygon, otherwise false. * \return Returns true if the point lies in the üpolygon, otherwise false.
*/ */
bool isInPolygon(std::vector<Triangle> &triangles, QPoint &point); bool isInPolygon(std::vector<Triangle> &triangles, QPoint &point);
} }
#endif #endif

View File

@@ -19,10 +19,10 @@
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent) PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent)
:QWidget(parent){ :QWidget(parent){
// Testing Area
// test yout tool here and reset after accomplished test // test yout tool here and reset after accomplished test
this->Tool = new IntelliToolFloodFill(this, &colorPicker); this->Tool = new IntelliToolFloodFill(this, &colorPicker);
this->setUp(maxWidth, maxHeight); this->setUp(maxWidth, maxHeight);
//tetsing
this->addLayer(200,200,0,0,ImageType::Shaped_Image); this->addLayer(200,200,0,0,ImageType::Shaped_Image);
layerBundle[0].image->drawPlain(QColor(255,0,0,255)); layerBundle[0].image->drawPlain(QColor(255,0,0,255));
std::vector<QPoint> polygon; std::vector<QPoint> polygon;

View File

@@ -13,7 +13,6 @@
#include "Tool/IntelliTool.h" #include "Tool/IntelliTool.h"
#include "IntelliHelper/IntelliColorPicker.h" #include "IntelliHelper/IntelliColorPicker.h"
struct LayerObject{ struct LayerObject{
IntelliImage* image; IntelliImage* image;
int width; int width;
@@ -58,7 +57,6 @@ public:
void createLineTool(); void createLineTool();
public slots: public slots:
// Events to handle // Events to handle
void slotActivateLayer(int a); void slotActivateLayer(int a);
void slotDeleteActiveLayer(); void slotDeleteActiveLayer();
@@ -95,7 +93,6 @@ private:
void resizeImage(QImage *image_res, const QSize &newSize); void resizeImage(QImage *image_res, const QSize &newSize);
//Helper for Tool //Helper for Tool
void createTempLayerAfter(int idx); void createTempLayerAfter(int idx);
}; };