diff --git a/colorpicker/colorpickerscene.hpp b/colorpicker/colorpickerscene.hpp index a536fbf..ab42f83 100644 --- a/colorpicker/colorpickerscene.hpp +++ b/colorpicker/colorpickerscene.hpp @@ -11,7 +11,7 @@ #include class ColorPickerScene : public QGraphicsScene, public QGraphicsView { - public: +public: ColorPickerScene(QPixmap *pixmap, QWidget *parentWidget); void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; @@ -25,7 +25,7 @@ class ColorPickerScene : public QGraphicsScene, public QGraphicsView { }); } - private: +private: QColor color; QGraphicsEllipseItem *ellipse = 0; QGraphicsPixmapItem *pItem = 0; diff --git a/cropeditor/cropeditor.hpp b/cropeditor/cropeditor.hpp index b1b74ea..9f6cd47 100644 --- a/cropeditor/cropeditor.hpp +++ b/cropeditor/cropeditor.hpp @@ -10,13 +10,13 @@ class CropEditor : public QObject { Q_OBJECT - public: +public: CropEditor(QPixmap *image, QObject *parent = 0); ~CropEditor(); - signals: +signals: QPixmap *cropped(QPixmap *pixmap); - private: +private: void crop(QRect rect); CropScene *scene = nullptr; CropView *view = nullptr; diff --git a/cropeditor/cropscene.hpp b/cropeditor/cropscene.hpp index 0f8d531..64703a3 100644 --- a/cropeditor/cropscene.hpp +++ b/cropeditor/cropscene.hpp @@ -15,7 +15,7 @@ class CropScene; class CropScene : public QGraphicsScene { Q_OBJECT - public: +public: CropScene(QObject *parent, QPixmap *pixmap); ~CropScene(); QPen &pen(); @@ -26,20 +26,20 @@ class CropScene : public QGraphicsScene { return _pixmap; } - public slots: +public slots: void fontAsk(); - signals: +signals: void closedWithRect(QRect rect); - protected: +protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *e) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *e) override; void contextMenuEvent(QGraphicsSceneContextMenuEvent *e) override; void keyReleaseEvent(QKeyEvent *e) override; - private: +private: void addDrawingAction(QMenu &menu, QString name, std::function item); void done(); std::function drawingSelectionMaker; diff --git a/cropeditor/cropview.hpp b/cropeditor/cropview.hpp index d72834c..66492c9 100644 --- a/cropeditor/cropview.hpp +++ b/cropeditor/cropview.hpp @@ -5,10 +5,10 @@ #include class CropView : public QGraphicsView { - public: +public: CropView(QGraphicsScene *scene); - protected: +protected: void keyPressEvent(QKeyEvent *e) override; }; diff --git a/cropeditor/drawing/bluritem.hpp b/cropeditor/drawing/bluritem.hpp index 82d3a54..c95229a 100644 --- a/cropeditor/drawing/bluritem.hpp +++ b/cropeditor/drawing/bluritem.hpp @@ -6,7 +6,7 @@ #include class BlurItem : public DrawItem { - public: +public: QString name() { return "Blur"; } @@ -17,7 +17,7 @@ class BlurItem : public DrawItem { void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; - private: +private: QGraphicsBlurEffect *effect; QPointF pos; QGraphicsRectItem *rect; diff --git a/cropeditor/drawing/dotitem.hpp b/cropeditor/drawing/dotitem.hpp index 32298b4..232f284 100644 --- a/cropeditor/drawing/dotitem.hpp +++ b/cropeditor/drawing/dotitem.hpp @@ -5,7 +5,7 @@ #include "drawitem.hpp" class DotItem : public DrawItem { - public: +public: DotItem(); ~DotItem(); QString name() { diff --git a/cropeditor/drawing/drawitem.hpp b/cropeditor/drawing/drawitem.hpp index c436703..b968551 100644 --- a/cropeditor/drawing/drawitem.hpp +++ b/cropeditor/drawing/drawitem.hpp @@ -7,7 +7,7 @@ class DrawItem; #include class DrawItem { - public: +public: virtual ~DrawItem() { } virtual QString name() = 0; diff --git a/cropeditor/drawing/lineitem.hpp b/cropeditor/drawing/lineitem.hpp index ec399a0..c72edd8 100644 --- a/cropeditor/drawing/lineitem.hpp +++ b/cropeditor/drawing/lineitem.hpp @@ -4,7 +4,7 @@ #include "drawitem.hpp" class LineItem : public DrawItem { - public: +public: LineItem(); QString name() override { return "Straight line"; @@ -12,7 +12,7 @@ class LineItem : public DrawItem { void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; - private: +private: QPointF init; QGraphicsLineItem *line; }; diff --git a/cropeditor/drawing/pathitem.hpp b/cropeditor/drawing/pathitem.hpp index 327770f..e2dfba9 100644 --- a/cropeditor/drawing/pathitem.hpp +++ b/cropeditor/drawing/pathitem.hpp @@ -5,7 +5,7 @@ #include "drawitem.hpp" class PathItem : public DrawItem { - public: +public: PathItem(); ~PathItem(); QString name() { @@ -14,7 +14,7 @@ class PathItem : public DrawItem { void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene); void mouseDragEndEvent(QGraphicsSceneMouseEvent *e, CropScene *scene); - private: +private: QPainterPath *path = nullptr; QGraphicsPathItem *pathItem = nullptr; }; diff --git a/cropeditor/drawing/textitem.cpp b/cropeditor/drawing/textitem.cpp index 29e9211..1c1a007 100644 --- a/cropeditor/drawing/textitem.cpp +++ b/cropeditor/drawing/textitem.cpp @@ -15,7 +15,8 @@ void TextItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { textItem->setPen(scene->pen()); textItem->setBrush(scene->brush()); } else { - auto ee = 180 + qRadiansToDegrees(qAtan2((textItem->pos().y() - e->scenePos().y()), (textItem->pos().x() - e->scenePos().x()))); + auto ee + = 180 + qRadiansToDegrees(qAtan2((textItem->pos().y() - e->scenePos().y()), (textItem->pos().x() - e->scenePos().x()))); textItem->setRotation(ee); } } diff --git a/cropeditor/drawing/textitem.hpp b/cropeditor/drawing/textitem.hpp index 28cf1a1..de469f7 100644 --- a/cropeditor/drawing/textitem.hpp +++ b/cropeditor/drawing/textitem.hpp @@ -5,13 +5,13 @@ #include class TextItem : public DrawItem { - public: +public: QString name() override; bool init(CropScene *) override; void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; - private: +private: QGraphicsSimpleTextItem *textItem = nullptr; QString text; }; diff --git a/cropeditor/settings/blurdialog.hpp b/cropeditor/settings/blurdialog.hpp index 4bcf618..f965c4b 100644 --- a/cropeditor/settings/blurdialog.hpp +++ b/cropeditor/settings/blurdialog.hpp @@ -11,15 +11,15 @@ class BlurDialog; class BlurDialog : public QDialog { Q_OBJECT - public: +public: explicit BlurDialog(QGraphicsBlurEffect *effect, QWidget *parent = 0); ~BlurDialog(); - private slots: +private slots: void on_radSpinner_valueChanged(double arg1); void on_radSlider_sliderMoved(int position); - private: +private: Ui::BlurDialog *ui; QGraphicsBlurEffect *effect; }; diff --git a/cropeditor/settings/brushpenselection.hpp b/cropeditor/settings/brushpenselection.hpp index de782e2..5c0183c 100644 --- a/cropeditor/settings/brushpenselection.hpp +++ b/cropeditor/settings/brushpenselection.hpp @@ -11,11 +11,11 @@ class BrushPenSelection; class BrushPenSelection : public QDialog { Q_OBJECT - public: +public: explicit BrushPenSelection(CropScene *scene); ~BrushPenSelection(); - private slots: +private slots: void on_penColor_clicked(bool); void on_brushColor_clicked(bool); @@ -25,7 +25,7 @@ class BrushPenSelection : public QDialog { void on_widthSlider_sliderMoved(int position); void on_widthSpinner_valueChanged(double arg1); - private: +private: Ui::BrushPenSelection *ui; CropScene *scene; QColor brush, pen; diff --git a/io/ioutils.cpp b/io/ioutils.cpp index 785f3d9..e42000b 100644 --- a/io/ioutils.cpp +++ b/io/ioutils.cpp @@ -8,7 +8,9 @@ namespace ioutils { QNetworkAccessManager networkManager; } -void ioutils::getJson(QUrl target, QList> headers, std::function callback) { +void ioutils::getJson(QUrl target, + QList> headers, + std::function callback) { QNetworkRequest req(target); for (auto header : headers) { req.setRawHeader(header.first.toUtf8(), header.second.toUtf8()); @@ -21,7 +23,10 @@ void ioutils::getJson(QUrl target, QList> headers, std:: }); } -void ioutils::postJson(QUrl target, QList> headers, QByteArray body, std::function callback) { +void ioutils::postJson(QUrl target, + QList> headers, + QByteArray body, + std::function callback) { QNetworkRequest req(target); for (auto header : headers) { req.setRawHeader(header.first.toUtf8(), header.second.toUtf8()); @@ -46,7 +51,10 @@ void ioutils::getData(QUrl target, QList> headers, std:: }); } -void ioutils::postData(QUrl target, QList> headers, QByteArray body, std::function callback) { +void ioutils::postData(QUrl target, + QList> headers, + QByteArray body, + std::function callback) { QNetworkRequest req(target); for (auto header : headers) { req.setRawHeader(header.first.toUtf8(), header.second.toUtf8()); diff --git a/io/ioutils.hpp b/io/ioutils.hpp index 5f3b138..c2423a8 100644 --- a/io/ioutils.hpp +++ b/io/ioutils.hpp @@ -10,7 +10,10 @@ namespace ioutils { extern QNetworkAccessManager networkManager; void getJson(QUrl target, QList> headers, std::function callback); -void postJson(QUrl target, QList> headers, QByteArray body, std::function callback); +void postJson(QUrl target, + QList> headers, + QByteArray body, + std::function callback); void getData(QUrl target, QList> headers, std::function callback); void postData(QUrl target, QList> headers, QByteArray body, std::function callback); }