summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qstyleditemdelegate.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-22 14:46:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-06 12:13:20 +0100
commitece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch)
treefa4a0fdbda040d24f1a2d07a320635c76980f431 /src/widgets/itemviews/qstyleditemdelegate.cpp
parentb19220d17fa66de5ded41690ffff263ee2af5c63 (diff)
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/qstyleditemdelegate.cpp')
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 702e290da3..f42af2ea00 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -83,7 +83,7 @@ class QStyledItemDelegatePrivate : public QAbstractItemDelegatePrivate
Q_DECLARE_PUBLIC(QStyledItemDelegate)
public:
- QStyledItemDelegatePrivate() : factory(0) { }
+ QStyledItemDelegatePrivate() : factory(nullptr) { }
static const QWidget *widget(const QStyleOptionViewItem &option)
{
@@ -351,7 +351,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
option->backgroundBrush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
// disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
- option->styleObject = 0;
+ option->styleObject = nullptr;
}
/*!
@@ -426,7 +426,7 @@ QWidget *QStyledItemDelegate::createEditor(QWidget *parent,
{
Q_D(const QStyledItemDelegate);
if (!index.isValid())
- return 0;
+ return nullptr;
return d->editorFactory()->createEditor(index.data(Qt::EditRole).userType(), parent);
}
@@ -450,7 +450,7 @@ void QStyledItemDelegate::setEditorData(QWidget *editor, const QModelIndex &inde
if (!n.isEmpty()) {
if (!v.isValid())
- v = QVariant(editor->property(n).userType(), (const void *)0);
+ v = QVariant(editor->property(n).userType(), (const void *)nullptr);
editor->setProperty(n, v);
}
#endif
@@ -507,7 +507,7 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor,
//or it is in a QTableView
#if QT_CONFIG(tableview) && QT_CONFIG(lineedit)
if (qobject_cast<QExpandingLineEdit*>(editor) && !qobject_cast<const QTableView*>(widget))
- opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, editor);
+ opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, nullptr, editor);
else
#endif
opt.showDecorationSelected = true;