forked from qt-creator/qt-creator
Utils: Introduce a Layouting::empty item
A bit more explicit than the current mix of Space() and asserting {}. Change-Id: Ia296b1d23294dfccd1e33827e136b821a4d2c6fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -1491,7 +1491,7 @@ void SelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
button->setChecked(i == value());
|
||||
button->setEnabled(option.enabled);
|
||||
button->setToolTip(option.tooltip);
|
||||
builder.addItems({{}, button});
|
||||
builder.addItems({Layouting::empty, button});
|
||||
d->m_buttons.append(button);
|
||||
d->m_buttonGroup->addButton(button, i);
|
||||
if (isAutoApply()) {
|
||||
|
@@ -75,7 +75,7 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
|
||||
using namespace Layouting;
|
||||
|
||||
Form {
|
||||
Space(), d->m_defaultSuffixLabel, br,
|
||||
empty, d->m_defaultSuffixLabel, br,
|
||||
tr("File name:"), d->m_nameLineEdit, br,
|
||||
tr("Path:"), d->m_pathChooser
|
||||
}.attachTo(this);
|
||||
|
@@ -511,6 +511,7 @@ LayoutBuilder::Setter title(const QString &title, BoolAspect *checker)
|
||||
|
||||
LayoutBuilder::Break br;
|
||||
LayoutBuilder::Stretch st;
|
||||
LayoutBuilder::Space empty(0);
|
||||
|
||||
} // Layouting
|
||||
} // Utils
|
||||
|
@@ -117,7 +117,7 @@ public:
|
||||
class QTCREATOR_UTILS_EXPORT Space : public LayoutItem
|
||||
{
|
||||
public:
|
||||
explicit Space(int space = 0);
|
||||
explicit Space(int space);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Span : public LayoutItem
|
||||
@@ -226,6 +226,7 @@ using Break = LayoutBuilder::Break; // FIXME: Remove
|
||||
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Break br;
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Stretch st;
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Space empty;
|
||||
|
||||
} // Layouting
|
||||
} // Utils
|
||||
|
@@ -353,7 +353,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
||||
downloadNdkToolButton->setIcon(downloadIcon);
|
||||
|
||||
using namespace Layouting;
|
||||
const Space empty;
|
||||
|
||||
Column {
|
||||
Group {
|
||||
|
@@ -109,7 +109,6 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
|
||||
useCustomizedStyle->setChecked(true);
|
||||
|
||||
using namespace Utils::Layouting;
|
||||
const Space empty;
|
||||
|
||||
Form {
|
||||
m_usePredefinedStyle, m_predefinedStyle, br,
|
||||
|
@@ -124,7 +124,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
|
||||
|
||||
if (!Utils::HostOsInfo::isMacHost()) {
|
||||
auto dpiCheckbox = new QCheckBox(tr("Enable high DPI scaling"));
|
||||
form.addRow({Space(), dpiCheckbox});
|
||||
form.addRow({empty, dpiCheckbox});
|
||||
const bool defaultValue = Utils::HostOsInfo::isWindowsHost();
|
||||
dpiCheckbox->setChecked(ICore::settings()->value(settingsKeyDPI, defaultValue).toBool());
|
||||
connect(dpiCheckbox, &QCheckBox::toggled, this, [defaultValue](bool checked) {
|
||||
@@ -135,7 +135,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
|
||||
});
|
||||
}
|
||||
|
||||
form.addRow({Space(), m_showShortcutsInContextMenus});
|
||||
form.addRow({empty, m_showShortcutsInContextMenus});
|
||||
form.addRow(Row{m_resetWarningsButton, st});
|
||||
form.addRow({tr("Text codec for tools:"), m_codecBox, st});
|
||||
Column{Group{Title(tr("User Interface")), form}}.attachTo(this);
|
||||
|
Reference in New Issue
Block a user