]> sigrok.org Git - pulseview.git/commitdiff
Fix random clazy warnings
authorSoeren Apel <redacted>
Sun, 21 Oct 2018 19:47:42 +0000 (21:47 +0200)
committerSoeren Apel <redacted>
Sun, 21 Oct 2018 19:47:42 +0000 (21:47 +0200)
Some of them are invalid, though, so we suppress them for
future clazy runs.

pv/dialogs/connect.cpp
pv/mainwindow.cpp
pv/views/trace/analogsignal.cpp
pv/views/trace/logicsignal.cpp
pv/views/trace/view.cpp
pv/widgets/wellarray.hpp

index ee05a0e1a06e09f12f6f524da5afc2d9c864af7f..084b1142c198c2b24b82ae3da4a00590f3d042c2 100644 (file)
@@ -221,7 +221,7 @@ void Connect::scan_pressed()
                const int index = serial_devices_.currentIndex();
                if (index >= 0 && index < serial_devices_.count() &&
                    serial_devices_.currentText() == serial_devices_.itemText(index))
-                       serial = serial_devices_.itemData(index).value<QString>();
+                       serial = serial_devices_.itemData(index).toString();
                else
                        serial = serial_devices_.currentText();
                drvopts[ConfigKey::CONN] = Variant<ustring>::create(
index 6b3319bed152f993e76eb0bf7dc51e63dbccbc17..dfabc9a06797f0a080ae16069b16de70f0929280 100644 (file)
@@ -172,8 +172,8 @@ shared_ptr<views::ViewBase> MainWindow::add_view(const QString &title,
                QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable);
 
        QAbstractButton *close_btn =
-               dock->findChildren<QAbstractButton*>
-                       ("qt_dockwidget_closebutton").front();
+               dock->findChildren<QAbstractButton*>("qt_dockwidget_closebutton")
+                       .front();  // clazy:exclude=detaching-temporary
 
        connect(close_btn, SIGNAL(clicked(bool)),
                this, SLOT(on_view_close_clicked()));
@@ -314,7 +314,7 @@ void MainWindow::remove_session(shared_ptr<Session> session)
                // drops to zero. We must prevent this to keep the static
                // widgets visible
                for (QWidget *w : static_tab_widget_->findChildren<QWidget*>())
-                       w->setMinimumHeight(h);
+                       w->setMinimumHeight(h);  // clazy:exclude=range-loop
 
                int margin = static_tab_widget_->layout()->contentsMargins().bottom();
                static_tab_widget_->setMinimumHeight(h + 2 * margin);
index 3fda4cb6251de1d95326288b19eeb1ae949e1480..ae3fe8d28e20e1dfd5c1802b473e9018d0bf7e9a 100644 (file)
@@ -236,7 +236,7 @@ void AnalogSignal::paint_back(QPainter &p, ViewItemPaintParams &pp)
 
                paint_axis(p, pp, get_visual_y());
        } else {
-               Trace::paint_back(p, pp);
+               Signal::paint_back(p, pp);
                paint_axis(p, pp, get_visual_y());
        }
 }
index a5d0a5987774436e178b0e3f250ce46633538d7d..5c6aa54b2779375b5868b4be3d7dde9bff5250f5 100644 (file)
@@ -584,7 +584,7 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form)
                // Only allow triggers to be changed when we're stopped
                if (session_.get_capture_state() != Session::Stopped)
                        for (QAction* action : trigger_bar_->findChildren<QAction*>())
-                               action->setEnabled(false);
+                               action->setEnabled(false);  // clazy:exclude=range-loop
 
                form->addRow(tr("Trigger"), trigger_bar_);
        }
index f1d7aa3dfca872a29bc81f5c0c2c444e4a34e03e..fa911f0b5ad92ae8a27c0f96b3d69de2de984aab 100644 (file)
@@ -1215,7 +1215,8 @@ void View::set_scroll_default()
 
 void View::determine_if_header_was_shrunk()
 {
-       const int header_pane_width = splitter_->sizes().front();
+       const int header_pane_width =
+               splitter_->sizes().front();  // clazy:exclude=detaching-temporary
 
        // Allow for a slight margin of error so that we also accept
        // slight differences when e.g. a label name change increased
@@ -1234,7 +1235,7 @@ void View::resize_header_to_fit()
        // splitter to the maximum allowed position.
 
        int splitter_area_width = 0;
-       for (int w : splitter_->sizes())
+       for (int w : splitter_->sizes())  // clazy:exclude=range-loop
                splitter_area_width += w;
 
        // Make sure the header has enough horizontal space to show all labels fully
index f1c25dc01fde9e0c39694594296c2bf265b6d2e5..194fe675a5bd6f5d16400d8f787a28939e45215e 100644 (file)
@@ -52,8 +52,8 @@ struct WellArrayData;
 class WellArray : public QWidget
 {
     Q_OBJECT
-    Q_PROPERTY(int selectedColumn READ selectedColumn)
-    Q_PROPERTY(int selectedRow READ selectedRow)
+    Q_PROPERTY(int selectedColumn READ selectedColumn)  // clazy-exclude:property-without-notify
+    Q_PROPERTY(int selectedRow READ selectedRow)  // clazy-exclude:property-without-notify
 
 public:
     WellArray(int rows, int cols, QWidget* parent = nullptr);