diff options
| author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-22 14:46:58 +0100 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-06 12:13:20 +0100 |
| commit | ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch) | |
| tree | fa4a0fdbda040d24f1a2d07a320635c76980f431 /src/widgets/itemviews/qlistview.cpp | |
| parent | b19220d17fa66de5ded41690ffff263ee2af5c63 (diff) | |
| download | qtbase-ece0c0a5e7e0b18beb58ccd868bde54c7be64f78.tar.gz | |
Tidy nullptr usage
Move away from using 0 as pointer literal.
Done using clang-tidy. This is not complete as
run-clang-tidy can't handle all of qtbase in one go.
Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qlistview.cpp')
| -rw-r--r-- | src/widgets/itemviews/qlistview.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 04cddf2926..de32082b5a 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -933,8 +933,8 @@ QStyleOptionViewItem QListView::viewOptions() const QStyleOptionViewItem option = QAbstractItemView::viewOptions(); if (!d->iconSize.isValid()) { // otherwise it was already set in abstractitemview int pm = (d->viewMode == QListView::ListMode - ? style()->pixelMetric(QStyle::PM_ListViewIconSize, 0, this) - : style()->pixelMetric(QStyle::PM_IconViewIconSize, 0, this)); + ? style()->pixelMetric(QStyle::PM_ListViewIconSize, nullptr, this) + : style()->pixelMetric(QStyle::PM_IconViewIconSize, nullptr, this)); option.decorationSize = QSize(pm, pm); } if (d->viewMode == QListView::IconMode) { @@ -1688,7 +1688,7 @@ bool QListView::event(QEvent *e) QListViewPrivate::QListViewPrivate() : QAbstractItemViewPrivate(), - commonListView(0), + commonListView(nullptr), wrap(false), space(0), flow(QListView::TopToBottom), @@ -1733,10 +1733,10 @@ void QListViewPrivate::prepareItemsLayout() // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy // is Qt::ScrollBarAsNeeded int verticalMargin = vbarpolicy==Qt::ScrollBarAsNeeded - ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, vbar) + frameAroundContents + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, nullptr, vbar) + frameAroundContents : 0; int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded - ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, hbar) + frameAroundContents + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, nullptr, hbar) + frameAroundContents : 0; layoutBounds.adjust(0, 0, -verticalMargin, -horizontalMargin); @@ -3072,7 +3072,7 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info) moved.resize(items.count()); QRect rect(QPoint(), topLeft); - QListViewItem *item = 0; + QListViewItem *item = nullptr; for (int row = info.first; row <= info.last; ++row) { item = &items[row]; if (isHidden(row)) { @@ -3178,7 +3178,7 @@ QVector<QModelIndex> QIconModeViewBase::intersectingSet(const QRect &area) const QVector<QModelIndex> res; that->interSectingVector = &res; that->tree.climbTree(area, &QIconModeViewBase::addLeaf, data); - that->interSectingVector = 0; + that->interSectingVector = nullptr; return res; } |
