X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fsignal.cpp;h=47e91f4b9a67f9a904d0b059e3da5cee543a35ab;hp=1896bba2c4a177ca26af309b005793be6dbbfc03;hb=812c0e3592e51946947b55c54b906bf4a0cb30e9;hpb=4c60462b00cc329e61daedd1c2e66724077bd412 diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 1896bba2..47e91f4b 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,6 +64,8 @@ Signal::Signal(pv::Session &session, Trace(QString::fromUtf8(channel->name().c_str())), session_(session), channel_(channel), + scale_handle_(make_shared(*this)), + items_({scale_handle_}), name_widget_(nullptr), updating_name_widget_(false) { @@ -99,17 +102,21 @@ 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::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_);