forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -74,10 +74,10 @@ WebBrowserSelectionAspect::WebBrowserSelectionAspect(ProjectExplorer::Target *ta
|
||||
setSettingsKey("RunConfiguration.WebBrowser");
|
||||
}
|
||||
|
||||
void WebBrowserSelectionAspect::addToConfigurationLayout(QFormLayout *layout)
|
||||
void WebBrowserSelectionAspect::addToLayout(ProjectExplorer::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!m_webBrowserComboBox);
|
||||
m_webBrowserComboBox = new QComboBox(layout->parentWidget());
|
||||
m_webBrowserComboBox = new QComboBox;
|
||||
m_webBrowserComboBox->addItems(m_availableBrowsers);
|
||||
m_webBrowserComboBox->setCurrentText(m_currentBrowser);
|
||||
connect(m_webBrowserComboBox, &QComboBox::currentTextChanged,
|
||||
@@ -85,7 +85,8 @@ void WebBrowserSelectionAspect::addToConfigurationLayout(QFormLayout *layout)
|
||||
m_currentBrowser = selectedBrowser;
|
||||
emit changed();
|
||||
});
|
||||
layout->addRow(tr("Web browser:"), m_webBrowserComboBox);
|
||||
builder.addItem(tr("Web browser:"));
|
||||
builder.addItem(m_webBrowserComboBox);
|
||||
}
|
||||
|
||||
void WebBrowserSelectionAspect::fromMap(const QVariantMap &map)
|
||||
|
||||
Reference in New Issue
Block a user