diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-07-13 20:39:05 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-08-17 09:51:32 +0200 |
commit | 13426aff248c25b44ac377f37dc3e3a54ea0ea86 (patch) | |
tree | 18dfc93c88f5a06460c9adddb681901711dacd30 /examples/widgets/animation/stickman/stickman.h | |
parent | cb3e1e551f340ce1e6280123d8b5411b3c1c96d8 (diff) |
Cleanup QtWidgets animation examples
Cleanup the QtWidgets animation examples:
- use nullptr
- use normalized includes, remove unused includes
- fix style
- fix crash of sub-attaq when the game ended (error during range-based
for loop porting)
- don't use keyword 'final' for a variable name
Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/animation/stickman/stickman.h')
-rw-r--r-- | examples/widgets/animation/stickman/stickman.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h index f2311a0358..63c02abc8f 100644 --- a/examples/widgets/animation/stickman/stickman.h +++ b/examples/widgets/animation/stickman/stickman.h @@ -57,8 +57,6 @@ static const int NodeCount = 16; static const int BoneCount = 24; class Node; -QT_BEGIN_NAMESPACE -QT_END_NAMESPACE class StickMan: public QGraphicsObject { Q_OBJECT @@ -67,7 +65,6 @@ class StickMan: public QGraphicsObject Q_PROPERTY(bool isDead WRITE setIsDead READ isDead) public: StickMan(); - ~StickMan(); QRectF boundingRect() const override; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; @@ -101,13 +98,11 @@ private: Node *m_nodes[NodeCount]; qreal m_perfectBoneLengths[BoneCount]; - uint m_sticks : 1; - uint m_isDead : 1; - uint m_reserved : 30; + bool m_sticks = true; + bool m_isDead = false; - QPixmap m_pixmap; - QColor m_penColor; - QColor m_fillColor; + QColor m_penColor = Qt::white; + QColor m_fillColor = Qt::black; }; #endif // STICKMAN_H |