From 13426aff248c25b44ac377f37dc3e3a54ea0ea86 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 13 Jul 2019 20:39:05 +0200 Subject: 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 --- examples/widgets/animation/stickman/stickman.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'examples/widgets/animation/stickman/stickman.h') 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 -- cgit v1.2.3