summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-11-22 15:34:38 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-11-22 20:43:55 +0100
commit2c871dfd38d89d6415c2c25d47b4a0e9c8b2ef11 (patch)
tree838c06f64a85ab297a1f5ab42d12f25c6d9613ef /src/widgets/graphicsview
parent7bb0d5379d74100593da4b14441a886f82c263b6 (diff)
Avoid initializing QFlags with 0 or nullptr in further cases
Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r--src/widgets/graphicsview/qgraphicssceneevent.cpp17
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp3
2 files changed, 7 insertions, 13 deletions
diff --git a/src/widgets/graphicsview/qgraphicssceneevent.cpp b/src/widgets/graphicsview/qgraphicssceneevent.cpp
index 5077a39d67..768dd07d4e 100644
--- a/src/widgets/graphicsview/qgraphicssceneevent.cpp
+++ b/src/widgets/graphicsview/qgraphicssceneevent.cpp
@@ -344,8 +344,7 @@ class QGraphicsSceneMouseEventPrivate : public QGraphicsSceneEventPrivate
Q_DECLARE_PUBLIC(QGraphicsSceneMouseEvent)
public:
inline QGraphicsSceneMouseEventPrivate()
- : button(Qt::NoButton),
- buttons(0), modifiers(0), source(Qt::MouseEventNotSynthesized), flags(0)
+ : button(Qt::NoButton), source(Qt::MouseEventNotSynthesized)
{ }
QPointF pos;
@@ -691,17 +690,15 @@ class QGraphicsSceneWheelEventPrivate : public QGraphicsSceneEventPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneWheelEvent)
public:
- inline QGraphicsSceneWheelEventPrivate()
- : buttons(0), modifiers(0), delta(0), orientation(Qt::Horizontal)
- { }
+ inline QGraphicsSceneWheelEventPrivate() = default;
QPointF pos;
QPointF scenePos;
QPoint screenPos;
Qt::MouseButtons buttons;
Qt::KeyboardModifiers modifiers;
- int delta;
- Qt::Orientation orientation;
+ int delta = 0;
+ Qt::Orientation orientation = Qt::Horizontal;
};
/*!
@@ -872,15 +869,13 @@ class QGraphicsSceneContextMenuEventPrivate : public QGraphicsSceneEventPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneContextMenuEvent)
public:
- inline QGraphicsSceneContextMenuEventPrivate()
- : modifiers(0), reason(QGraphicsSceneContextMenuEvent::Other)
- { }
+ inline QGraphicsSceneContextMenuEventPrivate() = default;
QPointF pos;
QPointF scenePos;
QPoint screenPos;
Qt::KeyboardModifiers modifiers;
- QGraphicsSceneContextMenuEvent::Reason reason;
+ QGraphicsSceneContextMenuEvent::Reason reason = QGraphicsSceneContextMenuEvent::Other;
};
/*!
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index f1ed0f3b4e..4c270b1af2 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -352,14 +352,13 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
alignment(Qt::AlignCenter),
transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
- optimizationFlags(0),
scene(0),
#if QT_CONFIG(rubberband)
rubberBanding(false),
rubberBandSelectionMode(Qt::IntersectsItemShape),
rubberBandSelectionOperation(Qt::ReplaceSelection),
#endif
- handScrollMotions(0), cacheMode(0),
+ handScrollMotions(0),
#ifndef QT_NO_CURSOR
hasStoredOriginalCursor(false),
#endif