aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ios/iosdevice.cpp
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2024-01-11 14:43:54 +0100
committerEike Ziller <[email protected]>2024-01-15 07:30:56 +0000
commitb2eac9acf823fb88fe8325a2e0c07fdf8908e7a3 (patch)
tree8bb2ee15b3d2a0a927d9fec6959bd8ff076c2b67 /src/plugins/ios/iosdevice.cpp
parent34b01f7530022881ce8b43eefeef9e83890bfb3c (diff)
iOS: Use layout builder for details in device preference widget
In Preferences > Devices > Devices > Type Specific. This makes it fit the style of other devices, and automatically makes it possible to select and copy text from it. Change-Id: I637858a939ada261504970611ffdb7eccf003c1c Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'src/plugins/ios/iosdevice.cpp')
-rw-r--r--src/plugins/ios/iosdevice.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp
index 838e04de954..c3853e0df94 100644
--- a/src/plugins/ios/iosdevice.cpp
+++ b/src/plugins/ios/iosdevice.cpp
@@ -15,15 +15,14 @@
#include <projectexplorer/devicesupport/idevicewidget.h>
#include <projectexplorer/kitaspects.h>
+#include <utils/layoutbuilder.h>
#include <utils/portlist.h>
#include <utils/process.h>
#include <solutions/tasking/tasktree.h>
-#include <QFormLayout>
#include <QJsonArray>
#include <QJsonDocument>
-#include <QLabel>
#include <QMessageBox>
#ifdef Q_OS_MAC
@@ -610,14 +609,16 @@ IosDeviceInfoWidget::IosDeviceInfoWidget(const IDevice::Ptr &device)
: IDeviceWidget(device)
{
const auto iosDevice = qSharedPointerCast<IosDevice>(device);
- const auto formLayout = new QFormLayout(this);
- formLayout->setContentsMargins(0, 0, 0, 0);
- setLayout(formLayout);
- formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
- formLayout->addRow(Tr::tr("Device name:"), new QLabel(iosDevice->deviceName()));
- formLayout->addRow(Tr::tr("Identifier:"), new QLabel(iosDevice->uniqueInternalDeviceId()));
- formLayout->addRow(Tr::tr("OS Version:"), new QLabel(iosDevice->osVersion()));
- formLayout->addRow(Tr::tr("CPU Architecture:"), new QLabel(iosDevice->cpuArchitecture()));
+ using namespace Layouting;
+ // clang-format off
+ Form {
+ Tr::tr("Device name:"), iosDevice->deviceName(), br,
+ Tr::tr("Identifier:"), iosDevice->uniqueInternalDeviceId(), br,
+ Tr::tr("OS Version:"), iosDevice->osVersion(), br,
+ Tr::tr("CPU Architecture:"), iosDevice->cpuArchitecture(),
+ noMargin
+ }.attachTo(this);
+ // clang-format on
}
} // Ios::Internal