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/dragdroprobot/coloritem.cpp | |
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/dragdroprobot/coloritem.cpp')
-rw-r--r-- | examples/widgets/graphicsview/dragdroprobot/coloritem.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp index 262e18a317..23fb5fda50 100644 --- a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp +++ b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp @@ -48,10 +48,18 @@ ** ****************************************************************************/ -#include <QtWidgets> - #include "coloritem.h" +#include <QApplication> +#include <QBitmap> +#include <QCursor> +#include <QDrag> +#include <QGraphicsSceneMouseEvent> +#include <QMimeData> +#include <QPainter> +#include <QRandomGenerator> +#include <QWidget> + //! [0] ColorItem::ColorItem() : color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256)) @@ -128,7 +136,7 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QPainter painter(&pixmap); painter.translate(15, 15); painter.setRenderHint(QPainter::Antialiasing); - paint(&painter, 0, 0); + paint(&painter, nullptr, nullptr); painter.end(); pixmap.setMask(pixmap.createHeuristicMask()); |