From dbbfb59ad9df7e36eacc6306b42c317e5c9e38ad Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 21 Jul 2022 10:01:05 +0200 Subject: [PATCH] Qnx: Use a bit of LayoutBuilder in QnxDeployLibrariesDialog Less user code. Change-Id: Ief2ad4c57a082752551db7db7d0020dd1775c7a1 Reviewed-by: Reviewed-by: Alessandro Portale --- .../qnx/qnxdeployqtlibrariesdialog.cpp | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp index 9a893c912a5..f68348cd860 100644 --- a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp +++ b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -70,28 +71,17 @@ QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const IDevice::ConstPtr & m_uploadService = new GenericDirectUploadService(this); m_uploadService->setDevice(m_device); - auto horizontalLayout = new QHBoxLayout(); - horizontalLayout->addWidget(m_qtLibraryCombo); - horizontalLayout->addWidget(m_deployButton); + using namespace Layouting; - auto horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setSpacing(0); - horizontalLayout_3->addWidget(m_basePathLabel); - horizontalLayout_3->addWidget(m_remoteDirectory); - - auto formLayout = new QFormLayout(); - formLayout->addRow(Tr::tr("Qt library to deploy:"), horizontalLayout); - formLayout->addRow(Tr::tr("Remote directory:"), horizontalLayout_3); - - auto horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->addItem(new QSpacerItem(218, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); - horizontalLayout_2->addWidget(m_closeButton); - - auto verticalLayout = new QVBoxLayout(this); - verticalLayout->addLayout(formLayout); - verticalLayout->addWidget(m_deployProgress); - verticalLayout->addWidget(m_deployLogWindow); - verticalLayout->addLayout(horizontalLayout_2); + Column { + Form { + Tr::tr("Qt library to deploy:"), m_qtLibraryCombo, m_deployButton, br, + Tr::tr("Remote directory:"), m_basePathLabel, m_remoteDirectory, br + }, + m_deployProgress, + m_deployLogWindow, + Row { st, m_closeButton } + }.attachTo(this); connect(m_uploadService, &AbstractRemoteLinuxDeployService::progressMessage, this, &QnxDeployQtLibrariesDialog::updateProgress);