diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-01 17:12:01 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-05 17:40:36 +0200 |
commit | 6f4bc3942dda076eedf38d8c8604eb4fa5d7bd3b (patch) | |
tree | 5813b88711ccfc1bb6f6948c1534fa407d4a4262 /examples/widgets/graphicsview/boxes/qtbox.h | |
parent | 42011c03613b38d2bf9c7770edf1392c5f5598f2 (diff) |
Widgets/GraphicsView examples: cleanup
Cleanup GraphicsView examples with the help of clang-tidy
- modernize-use-nullptr
- modernize-use-default-member-init
- modernize-use-override.IgnoreDestructors
- Some QList -> QVector changes
- use nullptr
- use normalized includes, remove unused includes
- fix style
Change-Id: I79347e55bfde52f6ae7749cc7093fbd442044020
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/graphicsview/boxes/qtbox.h')
-rw-r--r-- | examples/widgets/graphicsview/boxes/qtbox.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h index f8ee9bdb0a..84c8cb1d93 100644 --- a/examples/widgets/graphicsview/boxes/qtbox.h +++ b/examples/widgets/graphicsview/boxes/qtbox.h @@ -51,18 +51,17 @@ #ifndef QTBOX_H #define QTBOX_H -#include <QtWidgets> - -#include <QtGui/qvector3d.h> #include "glbuffers.h" +#include <QtWidgets> +#include <QVector3D> + class ItemBase : public QGraphicsItem { public: enum { Type = UserType + 1 }; ItemBase(int size, int x, int y); - virtual ~ItemBase(); QRectF boundingRect() const override; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; protected: @@ -84,7 +83,7 @@ protected: int m_size; QTime m_startTime; - bool m_isResizing; + bool m_isResizing = false; }; class QtBox : public ItemBase @@ -99,7 +98,7 @@ private: QVector3D m_vertices[8]; QVector3D m_texCoords[4]; QVector3D m_normals[6]; - GLTexture *m_texture; + GLTexture *m_texture = nullptr; }; class CircleItem : public ItemBase |