]> sigrok.org Git - pulseview.git/commitdiff
Use nullptr in a few places.
authorUwe Hermann <redacted>
Thu, 9 Mar 2017 23:11:45 +0000 (00:11 +0100)
committerUwe Hermann <redacted>
Sat, 11 Mar 2017 12:06:03 +0000 (13:06 +0100)
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,modernize-use-nullptr" -fix

pv/dialogs/settings.cpp
pv/mainwindow.cpp

index d443935efb765e2c88553b3540f6d6dc90e2f785..eb9e88b6755ddc2813d08d66f3fd208be7f6cd21 100644 (file)
@@ -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"));
index 985f698f8127f1e6efb2cf5f31ed067ec318c132..2e08d6a471476d9785702c794816b908a89983b3 100644 (file)
@@ -138,7 +138,7 @@ shared_ptr<views::ViewBase> 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<QDockWidget*>(w);
@@ -258,7 +258,7 @@ void MainWindow::remove_view(shared_ptr<views::ViewBase> 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<QDockWidget*>(w);