From c409988b235a55772537ef92e1a231bb0a75fa6e Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sun, 17 Nov 2019 21:15:04 +0100 Subject: [PATCH] Use proposed clang-tidy fixes --- pv/dialogs/settings.cpp | 2 +- pv/subwindows/decoder_selector/model.cpp | 2 +- pv/subwindows/decoder_selector/subwindow.cpp | 1 - pv/subwindows/decoder_selector/subwindow.hpp | 4 ++-- pv/widgets/popup.hpp | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index 55181e4c..0dc6b055 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -240,7 +240,7 @@ QWidget *Settings::get_general_settings_form(QWidget *parent) const if (current_style.isEmpty()) style_cb->setCurrentIndex(0); else - style_cb->setCurrentIndex(style_cb->findText(current_style, 0)); + style_cb->setCurrentIndex(style_cb->findText(current_style, nullptr)); connect(style_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(on_general_style_changed(int))); diff --git a/pv/subwindows/decoder_selector/model.cpp b/pv/subwindows/decoder_selector/model.cpp index 7b41a39f..dafe4f2d 100644 --- a/pv/subwindows/decoder_selector/model.cpp +++ b/pv/subwindows/decoder_selector/model.cpp @@ -128,7 +128,7 @@ QVariant DecoderCollectionModel::data(const QModelIndex& index, int role) const Qt::ItemFlags DecoderCollectionModel::flags(const QModelIndex& index) const { if (!index.isValid()) - return 0; + return nullptr; return Qt::ItemIsEnabled | Qt::ItemIsSelectable; } diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp index 610c61db..63cab9f9 100644 --- a/pv/subwindows/decoder_selector/subwindow.cpp +++ b/pv/subwindows/decoder_selector/subwindow.cpp @@ -33,7 +33,6 @@ #include "pv/subwindows/decoder_selector/subwindow.hpp" using std::reverse; -using std::shared_ptr; namespace pv { namespace subwindows { diff --git a/pv/subwindows/decoder_selector/subwindow.hpp b/pv/subwindows/decoder_selector/subwindow.hpp index 6b671cf5..c189fb24 100644 --- a/pv/subwindows/decoder_selector/subwindow.hpp +++ b/pv/subwindows/decoder_selector/subwindow.hpp @@ -65,7 +65,7 @@ class DecoderCollectionModel : public QAbstractItemModel Q_OBJECT public: - DecoderCollectionModel(QObject* parent = 0); + DecoderCollectionModel(QObject* parent = nullptr); QVariant data(const QModelIndex& index, int role) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; @@ -147,7 +147,7 @@ private: QCustomSortFilterProxyModel* sort_filter_model_; }; -} // decoder_selector +} // namespace decoder_selector } // namespace subwindows } // namespace pv diff --git a/pv/widgets/popup.hpp b/pv/widgets/popup.hpp index 736313c7..879c5f9d 100644 --- a/pv/widgets/popup.hpp +++ b/pv/widgets/popup.hpp @@ -37,7 +37,7 @@ class QWidthAdjustingScrollArea : public QScrollArea Q_OBJECT public: - QWidthAdjustingScrollArea(QWidget* parent = 0); + QWidthAdjustingScrollArea(QWidget* parent = nullptr); void setWidget(QWidget* w); bool eventFilter(QObject* obj, QEvent* ev); }; -- 2.30.2