From: Uwe Hermann Date: Wed, 29 Mar 2017 23:21:58 +0000 (+0200) Subject: Add a tooltip for the decoder name in the decoder popup. X-Git-Tag: pulseview-0.4.0~106 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=580b4f256919208cf270a2c050c167ed7cf46e8c;p=pulseview.git Add a tooltip for the decoder name in the decoder popup. --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 4a56c551..9132ea97 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -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) { diff --git a/pv/widgets/decodergroupbox.cpp b/pv/widgets/decodergroupbox.cpp index 26805c87..25e91533 100644 --- a/pv/widgets/decodergroupbox.cpp +++ b/pv/widgets/decodergroupbox.cpp @@ -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("

%1

").arg(title)), 0, 0); + auto *lbl = new QLabel(QString("

%1

").arg(title)); + lbl->setToolTip(tooltip); + layout_->addWidget(lbl, 0, 0); layout_->setColumnStretch(0, 1); QHBoxLayout *const toolbar = new QHBoxLayout; diff --git a/pv/widgets/decodergroupbox.hpp b/pv/widgets/decodergroupbox.hpp index a622d0b2..ed85bdf1 100644 --- a/pv/widgets/decodergroupbox.hpp +++ b/pv/widgets/decodergroupbox.hpp @@ -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);