From: Soeren Apel Date: Tue, 3 Jul 2018 16:24:40 +0000 (+0200) Subject: Connect dialog: Let the device list occupy only the minimum space needed X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=76f33d4c672c43c9d9c8b8a088f97535fb878f8a;p=pulseview.git Connect dialog: Let the device list occupy only the minimum space needed --- diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 911956af..29d5b026 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -102,6 +102,9 @@ Connect::Connect(QWidget *parent, pv::DeviceManager &device_manager) : tcp_config_layout->setContentsMargins(0, 0, 0, 0); tcp_config_->setEnabled(false); + // Let the device list occupy only the minimum space needed + device_list_.setMaximumHeight(device_list_.minimumSizeHint().height()); + QVBoxLayout *vbox_if = new QVBoxLayout; vbox_if->addWidget(radiobtn_usb); vbox_if->addWidget(radiobtn_serial); @@ -243,13 +246,10 @@ void Connect::scan_pressed() for (shared_ptr device : devices) { assert(device); - QString text = QString::fromStdString( - device->display_name(device_manager_)); - text += QString(" with %1 channels").arg( - device->device()->channels().size()); + QString text = QString::fromStdString(device->display_name(device_manager_)); + text += QString(" with %1 channels").arg(device->device()->channels().size()); - QListWidgetItem *const item = new QListWidgetItem(text, - &device_list_); + QListWidgetItem *const item = new QListWidgetItem(text, &device_list_); item->setData(Qt::UserRole, qVariantFromValue(device)); device_list_.addItem(item); }