forked from qt-creator/qt-creator
Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
.startNewRow().addItems({...}
- rename startNewRow() to finishRow()
Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -195,16 +195,13 @@ BuildStepConfigWidget *QbsInstallStep::createConfigWidget()
|
||||
commandLineTextEdit->setMinimumHeight(QFontMetrics(widget->font()).height() * 8);
|
||||
|
||||
LayoutBuilder builder(widget);
|
||||
builder.addItems(new QLabel(tr("Install root:")), installRootValueLabel);
|
||||
|
||||
builder.startNewRow();
|
||||
builder.addItem(new QLabel(tr("Flags:")));
|
||||
builder.addRow({tr("Install root:"), installRootValueLabel});
|
||||
builder.addRow(tr("Flags:"));
|
||||
m_dryRun->addToLayout(builder);
|
||||
m_keepGoing->addToLayout(builder);
|
||||
m_cleanInstallRoot->addToLayout(builder);
|
||||
|
||||
builder.startNewRow();
|
||||
builder.addItems(commandLineKeyLabel, commandLineTextEdit);
|
||||
builder.addRow({commandLineKeyLabel, commandLineTextEdit});
|
||||
|
||||
const auto updateState = [this, commandLineTextEdit, installRootValueLabel] {
|
||||
installRootValueLabel->setText(installRoot());
|
||||
|
||||
Reference in New Issue
Block a user