]> sigrok.org Git - pulseview.git/commitdiff
Add a tooltip for the decoder name in the decoder popup.
authorUwe Hermann <redacted>
Wed, 29 Mar 2017 23:21:58 +0000 (01:21 +0200)
committerUwe Hermann <redacted>
Thu, 30 Mar 2017 18:03:21 +0000 (20:03 +0200)
pv/view/decodetrace.cpp
pv/widgets/decodergroupbox.cpp
pv/widgets/decodergroupbox.hpp

index 4a56c551f91c6dc6b6db1f0f77a96b4dbd8a2052..9132ea97c7850e910bc19b04dd38eb009f04d036 100644 (file)
@@ -784,7 +784,10 @@ void DecodeTrace::create_decoder_form(int index,
 
        pv::widgets::DecoderGroupBox *const group =
                new pv::widgets::DecoderGroupBox(
-                       QString::fromUtf8(decoder->name), nullptr, decoder_deletable);
+                       QString::fromUtf8(decoder->name),
+                       tr("%1:\n%2").arg(QString::fromUtf8(decoder->longname),
+                               QString::fromUtf8(decoder->desc)),
+                       nullptr, decoder_deletable);
        group->set_decoder_visible(dec->shown());
 
        if (decoder_deletable) {
index 26805c87112485f7092ff77ccad3aa1b27a5c238..25e91533b5443b71e3dc8fdf77611208e8483600 100644 (file)
@@ -29,7 +29,7 @@
 namespace pv {
 namespace widgets {
 
-DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent, bool isDeletable) :
+DecoderGroupBox::DecoderGroupBox(QString title, QString tooltip, QWidget *parent, bool isDeletable) :
        QWidget(parent),
        layout_(new QGridLayout),
        show_hide_button_(QIcon(":/icons/decoder-shown.svg"), QString(), this)
@@ -37,7 +37,9 @@ DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent, bool isDeletabl
        layout_->setContentsMargins(0, 0, 0, 0);
        setLayout(layout_);
 
-       layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)), 0, 0);
+       auto *lbl = new QLabel(QString("<h3>%1</h3>").arg(title));
+       lbl->setToolTip(tooltip);
+       layout_->addWidget(lbl, 0, 0);
        layout_->setColumnStretch(0, 1);
 
        QHBoxLayout *const toolbar = new QHBoxLayout;
index a622d0b2e1e80874e8a15c6f54791f272dad392f..ed85bdf1b69ca21366ae46c296cdbbcc8f59356e 100644 (file)
@@ -33,8 +33,8 @@ class DecoderGroupBox : public QWidget
        Q_OBJECT
 
 public:
-       DecoderGroupBox(QString title, QWidget *parent = nullptr,
-               bool isDeletable = true);
+       DecoderGroupBox(QString title, QString tooltip,
+               QWidget *parent = nullptr, bool isDeletable = true);
 
        void add_layout(QLayout *layout);