From: Uwe Hermann Date: Thu, 9 Mar 2017 23:11:45 +0000 (+0100) Subject: Use nullptr in a few places. X-Git-Tag: pulseview-0.4.0~164 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=13e475e412663ee904b94a6510b5628bdb8b84fa Use nullptr in a few places. This patch was generated using clang-tidy: clang-tidy -checks="-*,modernize-use-nullptr" -fix --- diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index d443935e..eb9e88b6 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -31,7 +31,7 @@ namespace pv { namespace dialogs { Settings::Settings(QWidget *parent) : - QDialog(parent, 0) + QDialog(parent, nullptr) { QTabWidget *tab_stack = new QTabWidget(this); tab_stack->addTab(get_view_settings_form(tab_stack), tr("&Views")); diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 985f698f..2e08d6a4 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -138,7 +138,7 @@ shared_ptr MainWindow::get_active_view() const // ...otherwise find the dock widget the widget with focus is contained in QObject *w = QApplication::focusWidget(); - QDockWidget *dock = 0; + QDockWidget *dock = nullptr; while (w) { dock = qobject_cast(w); @@ -258,7 +258,7 @@ void MainWindow::remove_view(shared_ptr view) // call deleteLater() on it, which causes a double free // since the shared_ptr in view_docks_ doesn't know // that Qt keeps a pointer to the view around - view->setParent(0); + view->setParent(nullptr); // Delete the view's dock widget and all widgets inside it entry.first->deleteLater(); @@ -673,7 +673,7 @@ void MainWindow::on_view_close_clicked() { // Find the dock widget that contains the close button that was clicked QObject *w = QObject::sender(); - QDockWidget *dock = 0; + QDockWidget *dock = nullptr; while (w) { dock = qobject_cast(w);