summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/plugandpaint/app/paintarea.h
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-05-11 16:31:51 +0200
committerAndré Hartmann <aha_1980@gmx.de>2018-06-06 11:55:44 +0000
commita14a943f9ac3d1e85514d7fb6688c84e624ac850 (patch)
tree8da635836270c52a9289975bbf4eaa545f509398 /examples/widgets/tools/plugandpaint/app/paintarea.h
parent62abbe34b84a1c224d27f3eb2f735749f5f24b4f (diff)
Examples: Cleanup and modernize Plug&Paint
* Use C++11 member init * Use auto where appropriate * Replace foreach with range-for * Replace last Qt4-style connects * Sort includes to common style * Fix some Clang warnings Task-number: QTBUG-60635 Change-Id: I61c98b34b954e416dd175b56ca589125217083de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/widgets/tools/plugandpaint/app/paintarea.h')
-rw-r--r--examples/widgets/tools/plugandpaint/app/paintarea.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/tools/plugandpaint/app/paintarea.h b/examples/widgets/tools/plugandpaint/app/paintarea.h
index 1c8ee1ee1b..1d1e6006c8 100644
--- a/examples/widgets/tools/plugandpaint/app/paintarea.h
+++ b/examples/widgets/tools/plugandpaint/app/paintarea.h
@@ -63,7 +63,7 @@ class PaintArea : public QWidget
Q_OBJECT
public:
- PaintArea(QWidget *parent = 0);
+ PaintArea(QWidget *parent = nullptr);
bool openImage(const QString &fileName);
bool saveImage(const QString &fileName, const char *fileFormat);
@@ -87,13 +87,13 @@ protected:
private:
void setupPainter(QPainter &painter);
- QImage theImage;
- QColor color;
- int thickness;
+ QImage theImage = {500, 400, QImage::Format_RGB32};
+ QColor color = Qt::blue;
+ int thickness = 3;
- BrushInterface *brushInterface;
+ BrushInterface *brushInterface = nullptr;
QString brush;
- QPoint lastPos;
+ QPoint lastPos = {-1, -1};
QPainterPath pendingPath;
};