aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/items/qquickflickable.cpp
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff)
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r--src/quick/items/qquickflickable.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 95d1229c8d..8cb64377cc 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -172,13 +172,13 @@ class QQuickFlickableReboundTransition : public QQuickTransitionManager
{
public:
QQuickFlickableReboundTransition(QQuickFlickable *f, const QString &name)
- : flickable(f), axisData(0), propName(name), active(false)
+ : flickable(f), axisData(nullptr), propName(name), active(false)
{
}
~QQuickFlickableReboundTransition()
{
- flickable = 0;
+ flickable = nullptr;
}
bool startTransition(QQuickFlickablePrivate::AxisData *data, qreal toPos) {
@@ -252,12 +252,12 @@ QQuickFlickablePrivate::QQuickFlickablePrivate()
, lastPressTime(0)
, deceleration(QML_FLICK_DEFAULTDECELERATION)
, maxVelocity(QML_FLICK_DEFAULTMAXVELOCITY), reportedVelocitySmoothing(100)
- , delayedPressEvent(0), pressDelay(0), fixupDuration(400)
- , flickBoost(1.0), fixupMode(Normal), vTime(0), visibleArea(0)
+ , delayedPressEvent(nullptr), pressDelay(0), fixupDuration(400)
+ , flickBoost(1.0), fixupMode(Normal), vTime(0), visibleArea(nullptr)
, flickableDirection(QQuickFlickable::AutoFlickDirection)
, boundsBehavior(QQuickFlickable::DragAndOvershootBounds)
, boundsMovement(QQuickFlickable::FollowBoundsBehavior)
- , rebound(0)
+ , rebound(nullptr)
{
}
@@ -317,7 +317,7 @@ void QQuickFlickablePrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometr
{
Q_Q(QQuickFlickable);
if (item == contentItem) {
- Qt::Orientations orient = 0;
+ Qt::Orientations orient = nullptr;
if (change.xChange())
orient |= Qt::Horizontal;
if (change.yChange())
@@ -1555,7 +1555,7 @@ void QQuickFlickablePrivate::clearDelayedPress()
if (delayedPressEvent) {
delayedPressTimer.stop();
delete delayedPressEvent;
- delayedPressEvent = 0;
+ delayedPressEvent = nullptr;
}
}
@@ -1565,7 +1565,7 @@ void QQuickFlickablePrivate::replayDelayedPress()
if (delayedPressEvent) {
// Losing the grab will clear the delayed press event; take control of it here
QScopedPointer<QMouseEvent> mouseEvent(delayedPressEvent);
- delayedPressEvent = 0;
+ delayedPressEvent = nullptr;
delayedPressTimer.stop();
// If we have the grab, release before delivering the event
@@ -1858,7 +1858,7 @@ int QQuickFlickablePrivate::data_count(QQmlListProperty<QObject> *)
QObject *QQuickFlickablePrivate::data_at(QQmlListProperty<QObject> *, int)
{
// XXX todo
- return 0;
+ return nullptr;
}
void QQuickFlickablePrivate::data_clear(QQmlListProperty<QObject> *)