From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: 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 Reviewed-by: Lars Knoll --- src/widgets/itemviews/qstyleditemdelegate.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets/itemviews/qstyleditemdelegate.cpp') 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(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(editor) && !qobject_cast(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; -- cgit v1.2.3