X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fsignal.cpp;h=09a6da8f17a3d7b9b2377cfa0dc1a251e454edde;hp=bbabcc1b7709d62818a280d76c5f5ee887f95e4f;hb=838d0522bf01d4e7550f8c124135debd452f0cac;hpb=fe3a1c218407f6b8a0d7ac7c454593809212ea9e diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index bbabcc1b..09a6da8f 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -35,6 +35,7 @@ #include "view.hpp" using std::shared_ptr; +using std::make_shared; using sigrok::Channel; @@ -63,7 +64,9 @@ Signal::Signal(pv::Session &session, Trace(QString::fromUtf8(channel->name().c_str())), session_(session), channel_(channel), - name_widget_(NULL), + scale_handle_(make_shared(*this)), + items_({scale_handle_}), + name_widget_(nullptr), updating_name_widget_(false) { assert(channel_); @@ -99,17 +102,27 @@ shared_ptr Signal::channel() const return channel_; } -void Signal::populate_popup_form(QWidget *parent, QFormLayout *form) +const ViewItemOwner::item_list& Signal::child_items() const { - int index; + return items_; +} +void Signal::paint_back(QPainter &p, const ViewItemPaintParams &pp) +{ + if (channel_->enabled()) + Trace::paint_back(p, pp); +} + +void Signal::populate_popup_form(QWidget *parent, QFormLayout *form) +{ name_widget_ = new QComboBox(parent); name_widget_->setEditable(true); + name_widget_->setCompleter(0); - for(unsigned int i = 0; i < countof(ChannelNames); i++) + for (unsigned int i = 0; i < countof(ChannelNames); i++) name_widget_->insertItem(i, ChannelNames[i]); - index = name_widget_->findText(name_, Qt::MatchExactly); + const int index = name_widget_->findText(name_, Qt::MatchExactly); if (index == -1) { name_widget_->insertItem(0, name_);