From: Soeren Apel Date: Tue, 19 Mar 2019 09:14:12 +0000 (+0100) Subject: DecoderSelector: Put body label into a QScrollArea X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9c4ba1c1dda028f664239a126d0bc661d8b7b46a;p=pulseview.git DecoderSelector: Put body label into a QScrollArea --- diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp index 5e6dff5a..675e135c 100644 --- a/pv/subwindows/decoder_selector/subwindow.cpp +++ b/pv/subwindows/decoder_selector/subwindow.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "pv/session.hpp" @@ -110,10 +111,14 @@ SubWindow::SubWindow(Session& session, QWidget* parent) : tree_view_->setIndentation(10); + QScrollArea* info_label_body_container = new QScrollArea(); + info_label_body_container->setWidget(info_label_body_); + info_label_body_container->setWidgetResizable(true); + info_box_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QVBoxLayout* info_box_layout = new QVBoxLayout(info_box_); info_box_layout->addWidget(info_label_header_); - info_box_layout->addWidget(info_label_body_); + info_box_layout->addWidget(info_label_body_container); info_box_layout->addWidget(info_label_footer_); info_box_layout->setAlignment(Qt::AlignTop); Qt::TextInteractionFlags flags = Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard; @@ -194,7 +199,7 @@ void SubWindow::on_item_changed(const QModelIndex& index) const QString id = QString::fromUtf8(d->id); const QString longname = QString::fromUtf8(d->longname); const QString desc = QString::fromUtf8(d->desc); - const QString doc = QString::fromUtf8(srd_decoder_doc_get(d)); + const QString doc = QString::fromUtf8(srd_decoder_doc_get(d)).trimmed(); QString tags; for (GSList* li = (GSList*)d->tags; li; li = li->next) {