From: Soeren Apel Date: Tue, 17 Oct 2023 23:58:33 +0000 (+0200) Subject: Fix warning and remove cursor pair selected state X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5f0ea356391e0a3fa738cf5b4b5002b13946d99d;p=pulseview.git Fix warning and remove cursor pair selected state 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. --- diff --git a/pv/views/trace/cursorpair.cpp b/pv/views/trace/cursorpair.cpp index 7d7d8e4d..ec7b75ad 100644 --- a/pv/views/trace/cursorpair.cpp +++ b/pv/views/trace/cursorpair.cpp @@ -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()); diff --git a/pv/views/trace/marginwidget.cpp b/pv/views/trace/marginwidget.cpp index 537ffe5e..347b41ed 100644 --- a/pv/views/trace/marginwidget.cpp +++ b/pv/views/trace/marginwidget.cpp @@ -48,10 +48,10 @@ void MarginWidget::show_popup(const shared_ptr &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)