diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-12 17:39:00 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-16 12:52:29 +0200 |
commit | bb56560b6b323933773608d006fb282693ea6106 (patch) | |
tree | 1661fbb641ce72275cb5e2cc15c1f28e218ba578 /examples/widgets/painting/affine/xform.h | |
parent | a875503d9e001a05eb3c0998f6c1292f0fefc4e1 (diff) |
Polish the painting/affine example
- Use member initialization
- Remove C-style casts
- Add space around operators
- Use qsizetype for list indexes
- Remove commented out debugging code
Task-number: QTBUG-97095
Pick-to: 6.2
Change-Id: I11a17fa6e7f17968367a57291d83ee6fba731a34
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/widgets/painting/affine/xform.h')
-rw-r--r-- | examples/widgets/painting/affine/xform.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h index 1dce3b26da..0c28435057 100644 --- a/examples/widgets/painting/affine/xform.h +++ b/examples/widgets/painting/affine/xform.h @@ -88,7 +88,7 @@ public: void mousePressEvent(QMouseEvent *e) override; void resizeEvent(QResizeEvent *e) override; - HoverPoints *hoverPoints() { return pts; } + HoverPoints *hoverPoints() { return m_hoverPoints; } bool animation() const { return timer.isActive(); } qreal shear() const { return m_shear; } @@ -104,7 +104,7 @@ public: public slots: void setAnimation(bool animate); - void updateCtrlPoints(const QPolygonF &); + void updateControlPoints(const QPolygonF &); void changeRotation(int rotation); void changeScale(int scale); void changeShear(int shear); @@ -130,12 +130,12 @@ protected: #endif private: - QPolygonF ctrlPoints; - HoverPoints *pts; - qreal m_rotation; - qreal m_scale; - qreal m_shear; - XFormType m_type; + QPolygonF m_controlPoints{{250, 250}, {350, 250}}; + HoverPoints *m_hoverPoints; + qreal m_rotation = 0; + qreal m_scale = 1; + qreal m_shear = 0; + XFormType m_type = VectorType; QPixmap m_pixmap; QString m_text; QBasicTimer timer; |