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:
hjk
2020-09-18 04:54:41 +02:00
parent 7bba76d0ff
commit 2cabd2ceb5
20 changed files with 51 additions and 46 deletions

View File

@@ -91,7 +91,7 @@ void WebBrowserSelectionAspect::addToLayout(LayoutBuilder &builder)
m_currentBrowser = selectedBrowser;
emit changed();
});
builder.addItems(tr("Web browser:"), m_webBrowserComboBox);
builder.addItems({tr("Web browser:"), m_webBrowserComboBox});
}
void WebBrowserSelectionAspect::fromMap(const QVariantMap &map)