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/elasticnodes/graphwidget.cpp | |
parent | 42011c03613b38d2bf9c7770edf1392c5f5598f2 (diff) | |
download | qtbase-6f4bc3942dda076eedf38d8c8604eb4fa5d7bd3b.tar.gz |
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/elasticnodes/graphwidget.cpp')
-rw-r--r-- | examples/widgets/graphicsview/elasticnodes/graphwidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp index 9341d77f8d..a067f82ad7 100644 --- a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp +++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp @@ -59,7 +59,7 @@ //! [0] GraphWidget::GraphWidget(QWidget *parent) - : QGraphicsView(parent), timerId(0) + : QGraphicsView(parent) { QGraphicsScene *scene = new QGraphicsScene(this); scene->setItemIndexMethod(QGraphicsScene::NoIndex); @@ -163,7 +163,7 @@ void GraphWidget::timerEvent(QTimerEvent *event) { Q_UNUSED(event); - QList<Node *> nodes; + QVector<Node *> nodes; const QList<QGraphicsItem *> items = scene()->items(); for (QGraphicsItem *item : items) { if (Node *node = qgraphicsitem_cast<Node *>(item)) @@ -190,7 +190,7 @@ void GraphWidget::timerEvent(QTimerEvent *event) //! [5] void GraphWidget::wheelEvent(QWheelEvent *event) { - scaleView(pow((double)2, -event->angleDelta().y() / 240.0)); + scaleView(pow(2., -event->angleDelta().y() / 240.0)); } //! [5] #endif |