aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickgridview.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/qquickgridview.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/qquickgridview.cpp')
-rw-r--r--src/quick/items/qquickgridview.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index b2adf96f0e..1f5cda9d18 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -230,7 +230,7 @@ public:
: flow(QQuickGridView::FlowLeftToRight)
, cellWidth(100), cellHeight(100), columns(1)
, snapMode(QQuickGridView::NoSnap)
- , highlightXAnimator(0), highlightYAnimator(0)
+ , highlightXAnimator(nullptr), highlightYAnimator(nullptr)
{}
~QQuickGridViewPrivate()
{
@@ -390,7 +390,7 @@ FxViewItem *QQuickGridViewPrivate::snapItemAt(qreal pos) const
if (itemTop+rowSize()/2 >= pos && itemTop - rowSize()/2 <= pos)
return item;
}
- return 0;
+ return nullptr;
}
int QQuickGridViewPrivate::snapIndex() const
@@ -508,7 +508,7 @@ bool QQuickGridViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, qreal
}
int colNum = qFloor((colPos+colSize()/2) / colSize());
- FxGridItemSG *item = 0;
+ FxGridItemSG *item = nullptr;
bool changed = false;
QQmlIncubator::IncubationMode incubationMode = doBuffer ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested;
@@ -580,7 +580,7 @@ void QQuickGridViewPrivate::removeItem(FxViewItem *item)
bool QQuickGridViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
{
- FxGridItemSG *item = 0;
+ FxGridItemSG *item = nullptr;
bool changed = false;
while (visibleItems.count() > 1
@@ -700,14 +700,14 @@ void QQuickGridViewPrivate::createHighlight()
bool changed = false;
if (highlight) {
if (trackedItem == highlight)
- trackedItem = 0;
+ trackedItem = nullptr;
delete highlight;
- highlight = 0;
+ highlight = nullptr;
delete highlightXAnimator;
delete highlightYAnimator;
- highlightXAnimator = 0;
- highlightYAnimator = 0;
+ highlightXAnimator = nullptr;
+ highlightYAnimator = nullptr;
changed = true;
}
@@ -2410,7 +2410,7 @@ bool QQuickGridViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch
} else {
while (i >= 0) {
// item is before first visible e.g. in cache buffer
- FxViewItem *item = 0;
+ FxViewItem *item = nullptr;
if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))
item->index = modelIndex + i;
if (!item)
@@ -2462,7 +2462,7 @@ bool QQuickGridViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch
int i = 0;
int to = buffer+displayMarginEnd+tempPos+size()-1;
while (i < count && rowPos <= to + rowSize()*(columns - colNum)/qreal(columns+1)) {
- FxViewItem *item = 0;
+ FxViewItem *item = nullptr;
if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i))))
item->index = modelIndex + i;
bool newItem = !item;