X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdialogs%2Fconnect.cpp;h=29d5b0269a05d23777d1a78cccdb38067a2d045b;hb=f98070844c2d468fdbb6beb5b65e4ccbbcd3f10b;hp=43112ae5537f9e99cfeef0edc31c93aed13bd6de;hpb=1ebe875c5a51548c5182353e76c090215a3e5930;p=pulseview.git diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 43112ae5..29d5b026 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -14,16 +14,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include #include -#include #include +#include #include #include "connect.hpp" @@ -42,7 +41,6 @@ using Glib::VariantBase; using sigrok::ConfigKey; using sigrok::Driver; -using sigrok::Error; using pv::devices::HardwareDevice; @@ -104,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); @@ -245,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); }