]> sigrok.org Git - pulseview.git/commitdiff
Fix warning and remove cursor pair selected state
authorSoeren Apel <redacted>
Tue, 17 Oct 2023 23:58:33 +0000 (01:58 +0200)
committerSoeren Apel <redacted>
Wed, 18 Oct 2023 23:00:31 +0000 (01:00 +0200)
Fixes warning "QObject::connect: Cannot connect (nullptr)::closed() to pv::views::trace::Ruler::on_popup_closed()" and
removes showing the selected state for the cursor pair as it doesn't serve a purpose.

pv/views/trace/cursorpair.cpp
pv/views/trace/marginwidget.cpp

index 7d7d8e4d6477d2e9efbd2a5b84f1bd3f52ec9d79..ec7b75addd75180b9b26d288c4b1a20cb805fae9 100644 (file)
@@ -202,11 +202,13 @@ void CursorPair::paint_label(QPainter &p, const QRect &rect, bool hover)
 
        text_size_ = p.boundingRect(QRectF(), 0, text).size();
 
+       /* Currently, selecting the middle section between two cursors doesn't do
+        * anything, so don't highlight it when selected
        if (selected()) {
                p.setBrush(Qt::transparent);
                p.setPen(highlight_pen());
                p.drawRoundedRect(delta_rect, radius, radius);
-       }
+       } */
 
        p.setBrush(hover ? Cursor::FillColor.lighter() : Cursor::FillColor);
        p.setPen(Cursor::FillColor.darker());
index 537ffe5ef298ad29b1cc6dd00a9ab5bab1992fd5..347b41edfe7bcfb6afef775b58aa96568762fdb1 100644 (file)
@@ -48,10 +48,10 @@ void MarginWidget::show_popup(const shared_ptr<ViewItem> &item)
 {
        pv::widgets::Popup *const p = item->create_popup(this);
 
-       connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
-
-       if (p)
+       if (p) {
+               connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
                p->show();
+       }
 }
 
 void MarginWidget::contextMenuEvent(QContextMenuEvent *event)