aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ios
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-10-15 17:20:51 +0200
committerhjk <hjk@qt.io>2019-10-18 12:24:39 +0000
commit6eaf239777a3166f2504b0dff90bb4afcacba89f (patch)
tree32a2ffa2028e3ba487d62b380e40aab866c1e39f /src/plugins/ios
parent02350520c211bf5aa4f2804c1d19d28d710daa20 (diff)
ProjectExplorer: Prepare more flexibility to aspect layouting
This hides the explicit use of a QFormLayout from the aspect interface in a new LayoutBuilder class. That currently works only on a QFormLayout in the back, but opens the possibility to use e.g. a QGridLayout as use on the Kits and some option pages. The aspects now only announce sub-widgets they like to add, actuall positioning is does by a new LayoutBuilder class, also cramming several widgets in an hbox in the right column of the QFormLayout is done there. Change-Id: I2b788192c465f2ab82261849d34e514697c5a491 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/ios')
-rw-r--r--src/plugins/ios/iosrunconfiguration.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp
index b49f383051..92cb1965ab 100644
--- a/src/plugins/ios/iosrunconfiguration.cpp
+++ b/src/plugins/ios/iosrunconfiguration.cpp
@@ -84,7 +84,7 @@ public:
void fromMap(const QVariantMap &map) override;
void toMap(QVariantMap &map) const override;
- void addToConfigurationLayout(QFormLayout *layout) override;
+ void addToLayout(ProjectExplorer::LayoutBuilder &builder) override;
IosDeviceType deviceType() const;
void setDeviceType(const IosDeviceType &deviceType);
@@ -321,14 +321,15 @@ IosDeviceTypeAspect::IosDeviceTypeAspect(IosRunConfiguration *runConfiguration)
this, &IosDeviceTypeAspect::deviceChanges);
}
-void IosDeviceTypeAspect::addToConfigurationLayout(QFormLayout *layout)
+void IosDeviceTypeAspect::addToLayout(LayoutBuilder &builder)
{
- m_deviceTypeComboBox = new QComboBox(layout->parentWidget());
+ m_deviceTypeComboBox = new QComboBox;
m_deviceTypeComboBox->setModel(&m_deviceTypeModel);
- m_deviceTypeLabel = new QLabel(IosRunConfiguration::tr("Device type:"), layout->parentWidget());
+ m_deviceTypeLabel = new QLabel(IosRunConfiguration::tr("Device type:"));
- layout->addRow(m_deviceTypeLabel, m_deviceTypeComboBox);
+ builder.addItem(m_deviceTypeLabel);
+ builder.addItem(m_deviceTypeComboBox);
updateValues();