Utils: Introduce Layouting::{br,st}

... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-07-22 18:54:04 +02:00
parent 80aef9c0ef
commit 14257a24f9
71 changed files with 211 additions and 254 deletions

View File

@@ -73,7 +73,6 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
d->m_pathChooser = new PathChooser;
using namespace Layouting;
const Break br;
Form {
Space(), d->m_defaultSuffixLabel, br,

View File

@@ -509,5 +509,8 @@ LayoutBuilder::Setter title(const QString &title, BoolAspect *checker)
};
}
LayoutBuilder::Break br;
LayoutBuilder::Stretch st;
} // Layouting
} // Utils

View File

@@ -65,6 +65,8 @@ public:
Break,
};
using Modifier = std::function<void(QLayout *)>;
class QTCREATOR_UTILS_EXPORT LayoutItem
{
public:
@@ -215,11 +217,15 @@ public:
Form(std::initializer_list<LayoutItem> items) : LayoutBuilder(FormLayout, items) {}
};
using Stretch = LayoutBuilder::Stretch;
using Space = LayoutBuilder::Space;
using Span = LayoutBuilder::Span;
using AlignAsFormLabel = LayoutBuilder::AlignAsFormLabel;
using Break = LayoutBuilder::Break;
}
} // namespace Utils
using Stretch = LayoutBuilder::Stretch; // FIXME: Remove
using Break = LayoutBuilder::Break; // FIXME: Remove
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Break br;
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Stretch st;
} // Layouting
} // Utils

View File

@@ -124,7 +124,6 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
d->m_projectLabel->setVisible(d->m_forceSubProject);
using namespace Layouting;
const Break br;
Form {
tr("Name:"), d->m_nameLineEdit, br,
@@ -136,7 +135,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
Column {
d->m_descriptionLabel,
Stretch(),
st,
frame,
d->m_stateLabel
}.attachTo(this);

View File

@@ -99,7 +99,6 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close|QDialogButtonBox::Save);
using namespace Layouting;
const Break br;
Column {
Group {

View File

@@ -150,9 +150,6 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
packagesView->header()->setStretchLastSection(false);
using namespace Layouting;
const Break br;
const Stretch st;
Grid {
searchField, expandCheck, br,

View File

@@ -353,7 +353,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
downloadNdkToolButton->setIcon(downloadIcon);
using namespace Layouting;
const Break br;
const Space empty;
Column {
@@ -374,7 +373,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
empty, empty, sdkManagerToolButton, br,
Column { tr("Android NDK list:"), Stretch() },
Column { tr("Android NDK list:"), st },
m_ndkListWidget,
Column {
addCustomNdkButton,
@@ -400,7 +399,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
Span(4, openSslDetailsWidget)
}
},
Stretch(),
st
}.attachTo(this);
connect(m_sdkLocationPathChooser, &PathChooser::rawPathChanged,

View File

@@ -103,20 +103,19 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
m_hideTipTimer.setSingleShot(true);
using namespace Layouting;
const Break nl;
Column {
Form {
tr("Name:"), m_nameLineEdit, nl,
tr("Name:"), m_nameLineEdit, br,
tr("Device definition:"),
Row { m_deviceDefinitionTypeComboBox, m_deviceDefinitionComboBox }, nl,
tr("Architecture (ABI):"), m_abiComboBox, nl,
tr("Target API:"), m_targetApiComboBox, nl,
QString(), m_warningText, nl,
tr("SD card size:"), m_sdcardSizeSpinBox, nl,
Row { m_deviceDefinitionTypeComboBox, m_deviceDefinitionComboBox }, br,
tr("Architecture (ABI):"), m_abiComboBox, br,
tr("Target API:"), m_targetApiComboBox, br,
QString(), m_warningText, br,
tr("SD card size:"), m_sdcardSizeSpinBox, br,
QString(), m_overwriteCheckBox,
},
Stretch(),
st,
m_buttonBox
}.attachTo(this);

View File

@@ -113,18 +113,17 @@ BoostTestSettingsPage::BoostTestSettingsPage(BoostTestSettings *settings, Utils:
setLayouter([settings](QWidget *widget) {
BoostTestSettings &s = *settings;
using namespace Layouting;
const Break nl;
Grid grid {
s.logLevel, nl,
s.reportLevel, nl,
s.randomize, Row { s.seed }, nl,
s.systemErrors, nl,
s.fpExceptions, nl,
s.logLevel, br,
s.reportLevel, br,
s.randomize, Row { s.seed }, br,
s.systemErrors, br,
s.fpExceptions, br,
s.memLeaks,
};
Column { Row { Column { grid, Stretch() }, Stretch() } }.attachTo(widget);
Column { Row { Column { grid, st }, st } }.attachTo(widget);
});
}

View File

@@ -145,22 +145,21 @@ CatchTestSettingsPage::CatchTestSettingsPage(CatchTestSettings *settings, Utils:
setLayouter([settings](QWidget *widget) {
CatchTestSettings &s = *settings;
using namespace Layouting;
const Break nl;
Grid col {
s.showSuccess, nl,
s.breakOnFailure, nl,
s.noThrow, nl,
s.visibleWhitespace, nl,
s.abortAfterChecked, s.abortAfter, nl,
s.samplesChecked, s.benchmarkSamples, nl,
s.resamplesChecked, s.benchmarkResamples, nl,
s.confidenceIntervalChecked, s.confidenceInterval, nl,
s.warmupChecked, s.benchmarkWarmupTime, nl,
s.showSuccess, br,
s.breakOnFailure, br,
s.noThrow, br,
s.visibleWhitespace, br,
s.abortAfterChecked, s.abortAfter, br,
s.samplesChecked, s.benchmarkSamples, br,
s.resamplesChecked, s.benchmarkResamples, br,
s.confidenceIntervalChecked, s.confidenceInterval, br,
s.warmupChecked, s.benchmarkWarmupTime, br,
s.noAnalysis
};
Column { Row { col, Stretch() }, Stretch() }.attachTo(widget);
Column { Row { col, st }, st }.attachTo(widget);
});
}

View File

@@ -147,27 +147,26 @@ CTestSettingsPage::CTestSettingsPage(CTestSettings *settings, Utils::Id settings
setLayouter([settings](QWidget *widget) {
CTestSettings &s = *settings;
using namespace Utils::Layouting;
const Break nl;
Form form {
Row {s.outputOnFail}, nl,
Row {s.scheduleRandom}, nl,
Row {s.stopOnFailure}, nl,
Row {s.outputMode}, nl,
Row {s.outputOnFail}, br,
Row {s.scheduleRandom}, br,
Row {s.stopOnFailure}, br,
Row {s.outputMode}, br,
Group {
Title(tr("Repeat tests"), &s.repeat),
Row {s.repetitionMode, s.repetitionCount},
}, nl,
}, br,
Group {
Title(tr("Run in parallel"), &s.parallel),
Column {
Row {s.jobs}, nl,
Row {s.jobs}, br,
Row {s.testLoad, s.threshold}
}
}
};
Column {Row {Column { form , Stretch() }, Stretch() } }.attachTo(widget);
Column { Row { Column { form , st }, st } }.attachTo(widget);
});
}

View File

@@ -143,12 +143,11 @@ GTestSettingsPage::GTestSettingsPage(GTestSettings *settings, Utils::Id settings
setLayouter([settings](QWidget *widget) {
GTestSettings &s = *settings;
using namespace Layouting;
const Break nl;
Grid grid {
s.runDisabled, nl,
s.breakOnFailure, nl,
s.repeat, s.iterations, nl,
s.runDisabled, br,
s.breakOnFailure, br,
s.repeat, s.iterations, br,
s.shuffle, s.seed
};
@@ -157,7 +156,7 @@ GTestSettingsPage::GTestSettingsPage(GTestSettings *settings, Utils::Id settings
s.gtestFilter
};
Column { Row { Column { grid, form, Stretch() }, Stretch() } }.attachTo(widget);
Column { Row { Column { grid, form, st }, st } }.attachTo(widget);
});
}

View File

@@ -138,7 +138,7 @@ QtTestSettingsPage::QtTestSettingsPage(QtTestSettings *settings, Id settingsId)
},
};
Column { Row { col, Stretch() }, Stretch() }.attachTo(widget);
Column { Row { col, st }, st }.attachTo(widget);
});
}

View File

@@ -188,16 +188,16 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
m_omitInternalMsgCB,
m_omitRunConfigWarnCB,
m_limitResultOutputCB,
Row { m_limitResultDescriptionCb, m_limitResultDescriptionSpinBox, Stretch()},
Row { m_limitResultDescriptionCb, m_limitResultDescriptionSpinBox, st },
m_openResultsOnStartCB,
m_openResultsOnFinishCB,
Row { Space(20), m_openResultsOnFailCB },
m_autoScrollCB,
m_displayAppCB,
m_processArgsCB,
Row { new QLabel(tr("Automatically run")), m_runAfterBuildCB, Stretch() },
Row { timeoutLabel, m_timeoutSpin, Stretch() },
Row { resetChoicesButton, Stretch() }
Row { new QLabel(tr("Automatically run")), m_runAfterBuildCB, st },
Row { timeoutLabel, m_timeoutSpin, st },
Row { resetChoicesButton, st }
}
};
@@ -211,10 +211,10 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
Column {
Row {
Column { generalGroup, Stretch() },
Column { activeFrameworks, Stretch() }
Column { generalGroup, st },
Column { activeFrameworks, st }
},
Stretch()
st
}.attachTo(this);
connect(m_frameworkTreeWidget, &QTreeWidget::itemChanged,

View File

@@ -123,11 +123,10 @@ BazaarSettingsPage::BazaarSettingsPage(BazaarSettings *settings)
Row {
s.logCount,
s.timeout,
Stretch()
st
}
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -109,7 +109,6 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
m_command->setFilePath(m_settings->command());
using namespace Utils::Layouting;
const Break br;
Column {
m_useOtherFiles,
@@ -127,7 +126,7 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
}
},
options,
Stretch()
st
}.attachTo(this);
connect(m_command, &Utils::PathChooser::validChanged, options, &QWidget::setEnabled);

View File

@@ -109,7 +109,6 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
useCustomizedStyle->setChecked(true);
using namespace Utils::Layouting;
const Break br;
const Space empty;
Form {
@@ -127,7 +126,7 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
}
},
options,
Stretch()
st
}.attachTo(this);
connect(m_command, &Utils::PathChooser::validChanged, options, &QWidget::setEnabled);

View File

@@ -84,7 +84,6 @@ GeneralOptionsPageWidget::GeneralOptionsPageWidget(const QStringList &toolIds)
m_autoFormatTool->setCurrentIndex(qMax(index, 0));
using namespace Utils::Layouting;
const Break br;
Column {
Group {
@@ -96,7 +95,7 @@ GeneralOptionsPageWidget::GeneralOptionsPageWidget(const QStringList &toolIds)
Span(2, m_autoFormatOnlyCurrentProject)
}
},
Stretch()
st
}.attachTo(this);
connect(m_autoFormat, &QCheckBox::toggled, m_autoFormatTool, &QComboBox::setEnabled);

View File

@@ -112,7 +112,6 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
auto options = new QGroupBox(tr("Options"));
using namespace Utils::Layouting;
const Break br;
Column {
m_useOtherFiles,
@@ -131,7 +130,7 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
}
},
options,
Stretch()
st
}.attachTo(this);
connect(m_command, &Utils::PathChooser::validChanged, options, &QWidget::setEnabled);

View File

@@ -89,13 +89,8 @@ ClangToolsProjectSettingsWidget::ClangToolsProjectSettingsWidget(ProjectExplorer
m_removeAllButton = new QPushButton(tr("Remove All"));
using namespace Utils::Layouting;
Column {
Row {
m_restoreGlobal,
Stretch(),
gotoAnalyzerModeLabel
},
Row { m_restoreGlobal, st, gotoAnalyzerModeLabel },
m_runSettingsWidget,
@@ -106,7 +101,7 @@ ClangToolsProjectSettingsWidget::ClangToolsProjectSettingsWidget(ProjectExplorer
Column {
m_removeSelectedButton,
m_removeAllButton,
Stretch()
st
}
}
}

View File

@@ -327,7 +327,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) :
using namespace Layouting;
Grid cmakeConfiguration {
m_filterEdit, Break(),
m_filterEdit, br,
findWrapper,
Column {
m_addButton,
@@ -338,7 +338,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) :
m_batchEditButton,
Space(10),
m_showAdvancedCheckBox,
Stretch()
st
}
};

View File

@@ -102,7 +102,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett
s.packageManagerAutoSetup,
s.askBeforeReConfigureInitialParams,
s.showSourceSubFolders,
Stretch(),
st
}.attachTo(widget);
});
}

View File

@@ -219,7 +219,7 @@ NewDialogWidget::NewDialogWidget(QWidget *parent)
Column {
Row { QCoreApplication::translate("Core::Internal::NewDialog", "Choose a template:"),
Stretch(), m_comboBox },
st, m_comboBox },
Row { m_templateCategoryView, m_templatesView, frame },
buttonBox
}.attachTo(this);

View File

@@ -118,9 +118,9 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
resetColorButton->setToolTip(tr("Reset to default.", "Color"));
Form form;
form.addRow({tr("Color:"), m_colorButton, resetColorButton, Stretch()});
form.addRow({tr("Color:"), m_colorButton, resetColorButton, st});
form.addRow({tr("Theme:"), m_themeChooser});
form.addRow({tr("Language:"), m_languageBox, Stretch()});
form.addRow({tr("Language:"), m_languageBox, st});
if (!Utils::HostOsInfo::isMacHost()) {
auto dpiCheckbox = new QCheckBox(tr("Enable high DPI scaling"));
@@ -136,8 +136,8 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
}
form.addRow({Space(), m_showShortcutsInContextMenus});
form.addRow(Row{m_resetWarningsButton, Stretch()});
form.addRow({tr("Text codec for tools:"), m_codecBox, Stretch()});
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);
fillLanguageBox();

View File

@@ -227,8 +227,6 @@ public:
m_editButton->setEnabled(false);
using namespace Layouting;
static const Break br;
static const Stretch st;
Column buttons{addButton, m_removeButton, m_editButton, st};

View File

@@ -93,8 +93,6 @@ UrlFilterOptions::UrlFilterOptions(UrlLocatorFilter *filter, QWidget *parent)
buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
using namespace Layouting;
static const Break br;
static const Stretch st;
Column buttons { add, remove, moveUp, moveDown, st };

View File

@@ -186,31 +186,31 @@ public:
form.addRow({patchCommandLabel, Span(2, m_patchChooser)});
if (HostOsInfo::isMacHost()) {
form.addRow({fileSystemCaseSensitivityLabel,
Span(2, Row{m_fileSystemCaseSensitivityChooser, Stretch()})});
Span(2, Row{m_fileSystemCaseSensitivityChooser, st})});
}
form.addRow(
{tr("When files are externally modified:"), Span(2, Row{m_reloadBehavior, Stretch()})});
{tr("When files are externally modified:"), Span(2, Row{m_reloadBehavior, st})});
form.addRow(
{m_autoSaveCheckBox, Span(2, Row{tr("Interval:"), m_autoSaveInterval, Stretch()})});
{m_autoSaveCheckBox, Span(2, Row{tr("Interval:"), m_autoSaveInterval, st})});
form.addRow(Span(3, m_autoSaveRefactoringCheckBox));
form.addRow({m_autoSuspendCheckBox,
Span(2, Row{autoSuspendLabel, m_autoSuspendMinDocumentCount, Stretch()})});
form.addRow(Span(3, Row{m_warnBeforeOpeningBigFiles, m_bigFilesLimitSpinBox, Stretch()}));
Span(2, Row{autoSuspendLabel, m_autoSuspendMinDocumentCount, st})});
form.addRow(Span(3, Row{m_warnBeforeOpeningBigFiles, m_bigFilesLimitSpinBox, st}));
form.addRow(Span(3,
Row{tr("Maximum number of entries in \"Recent Files\":"),
m_maxRecentFilesSpinBox,
Stretch()}));
st}));
form.addRow(m_askBeforeExitCheckBox);
#ifdef ENABLE_CRASHPAD
form.addRow(
Span(3, Row{m_enableCrashReportingCheckBox, helpCrashReportingButton, Stretch()}));
form.addRow(Span(3, Row{m_clearCrashReportsButton, m_crashReportsSizeText, Stretch()}));
Span(3, Row{m_enableCrashReportingCheckBox, helpCrashReportingButton, st}));
form.addRow(Span(3, Row{m_clearCrashReportsButton, m_crashReportsSizeText, st}));
#endif
Column {
Group {
Title(tr("System")),
Column { form, Stretch() }
Column { form, st }
}
}.attachTo(this);

View File

@@ -71,11 +71,11 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSe
Column {
Form {
label, Break(),
label, br,
s.path,
s.displayCount
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -94,7 +94,7 @@ SettingsPage::SettingsPage(Settings *settings)
},
s.copyToClipboard,
s.displayOutput,
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -109,10 +109,10 @@ CppCodeModelSettingsWidget::CppCodeModelSettingsWidget(CppCodeModelSettings *s)
Column {
m_interpretAmbiguousHeadersAsCHeaders,
m_ignorePchCheckBox,
Row { m_skipIndexingBigFilesCheckBox, m_bigFilesLimitSpinBox, Stretch() },
Row { m_skipIndexingBigFilesCheckBox, m_bigFilesLimitSpinBox, st },
}
},
Stretch()
st
}.attachTo(this);
}

View File

@@ -121,7 +121,7 @@ CvsSettingsPage::CvsSettingsPage(CvsSettings *settings)
s.describeByCommitId,
}
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -56,7 +56,7 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec
details->setWidget(innerPane);
Column {
Row { settingsCombo, restoreButton, Stretch() },
Row { settingsCombo, restoreButton, st },
configWidget
}.attachTo(innerPane);

View File

@@ -202,7 +202,7 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
Column {
s.cdbAdditionalArguments,
s.useCdbConsole,
Stretch()
st
}
},
@@ -230,7 +230,7 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
}
},
Stretch()
st
}.attachTo(this);
}
@@ -283,7 +283,7 @@ CdbPathsPageWidget::CdbPathsPageWidget()
Column {
Group { Title(Tr::tr("Symbol Paths")), Column { m_symbolPaths } },
Group { Title(Tr::tr("Source Paths")), Column { m_sourcePaths } },
Stretch()
st
}.attachTo(this);
}

View File

@@ -63,7 +63,7 @@ public:
s.raiseOnInterrupt,
s.breakpointsFullPathByDefault,
s.warnOnReleaseBuilds,
Row { s.maximalStackDepth, Stretch() }
Row { s.maximalStackDepth, st }
};
Column col2 {
@@ -73,13 +73,13 @@ public:
s.stationaryEditorWhileStepping,
s.forceLoggingToConsole,
s.registerForPostMortem,
Stretch()
st
};
Column {
Group { Title("Behavior"), Row { col1, col2, Stretch() } },
Group { Title("Behavior"), Row { col1, col2, st } },
s.sourcePathMap,
Stretch()
st
}.attachTo(this);
}
@@ -174,8 +174,7 @@ public:
};
Grid limits {
s.maximalStringLength,
Break(),
s.maximalStringLength, br,
s.displayStringLimit
};
@@ -187,8 +186,8 @@ public:
s.showQtNamespace,
s.showQObjectNames,
Space(10),
Row { limits, Stretch() },
Stretch()
Row { limits, st },
st
}.attachTo(this);
}

View File

@@ -61,7 +61,7 @@ public:
Group general {
title(Tr::tr("General")),
Column {
Row { s.gdbWatchdogTimeout, Stretch() },
Row { s.gdbWatchdogTimeout, st },
s.skipKnownFrames,
s.useMessageBoxForSignals,
s.adjustBreakpointLocations,
@@ -71,7 +71,7 @@ public:
s.intelFlavor,
s.usePseudoTracepoints,
s.useIndexCache,
Stretch()
st
}
};
@@ -84,7 +84,7 @@ public:
title(Tr::tr("Additional Attach Commands")),
Column { s.gdbPostAttachCommands },
},
Stretch()
st
};
Row { general, commands }.attachTo(w);
@@ -132,7 +132,7 @@ public:
}
};
Column { extended, Stretch() }.attachTo(w);
Column { extended, st }.attachTo(w);
});
}
};

View File

@@ -177,15 +177,15 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
using namespace Layouting;
Form {
repoLabel, m_repoLineEdit, Break(),
tagLabel, m_tagLineEdit, Break(),
idLabel, m_idLineEdit, Break(),
daemonStateLabel, m_daemonReset, m_daemonState, Break(),
m_runAsOutsideUser, Break(),
repoLabel, m_repoLineEdit, br,
tagLabel, m_tagLineEdit, br,
idLabel, m_idLineEdit, br,
daemonStateLabel, m_daemonReset, m_daemonState, br,
m_runAsOutsideUser, br,
Column {
pathListLabel,
m_pathsListEdit,
}, Break(),
}, br,
Column {
Space(20),
Row {
@@ -196,9 +196,9 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
autoDetectButton,
undoAutoDetectButton,
listAutoDetectedButton,
Stretch(),
st,
},
new QLabel(Tr::tr("Detection log:")),
Tr::tr("Detection log:"),
logView
}
}.attachTo(this);

View File

@@ -75,7 +75,7 @@ DockerSettingsPage::DockerSettingsPage(DockerSettings *settings)
Title(Tr::tr("Configuration")),
Row { s.dockerBinaryPath }
},
Stretch()
st
}.attachTo(widget);
// clang-format on
});

View File

@@ -416,7 +416,7 @@ void FakeVimOptionPage::layoutPage(QWidget *widget)
}
};
Row ints { s.shiftWidth, s.tabStop, s.scrollOff, Stretch() };
Row ints { s.shiftWidth, s.tabStop, s.scrollOff, st };
Column strings {
s.backspace,
@@ -447,8 +447,8 @@ void FakeVimOptionPage::layoutPage(QWidget *widget)
}
},
Row { copyTextEditorSettings, setQtStyle, setPlainStyle, Stretch() },
Stretch()
Row { copyTextEditorSettings, setQtStyle, setPlainStyle, st },
st
}.attachTo(widget, true);

View File

@@ -179,7 +179,7 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
Group {
Title(GitSettings::tr("Miscellaneous")),
Column {
Row { s.logCount, s.timeout, Stretch() },
Row { s.logCount, s.timeout, st },
s.pullRebase
}
},
@@ -194,7 +194,7 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
Row { s.repositoryBrowserCmd }
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -118,7 +118,6 @@ GitLabDialog::GitLabDialog(QWidget *parent)
buttonBox->addButton(m_clonePB, QDialogButtonBox::ActionRole);
using namespace Layouting;
const Stretch st;
Column {
Row {

View File

@@ -146,14 +146,13 @@ GitLabOptionsWidget::GitLabOptionsWidget(QWidget *parent)
m_add->setToolTip(tr("Add new GitLab server configuration."));
using namespace Utils::Layouting;
const Break nl;
Grid {
Form {
defaultLabel, m_defaultGitLabServer, nl,
Row { Group { Column { m_gitLabServerWidget, Space(1) } } }, nl,
m_curl, nl,
}, Column { m_add, m_edit, m_remove, Stretch() },
defaultLabel, m_defaultGitLabServer, br,
Row { Group { Column { m_gitLabServerWidget, Space(1) } } }, br,
m_curl, br,
}, Column { m_add, m_edit, m_remove, st },
}.attachTo(this);
connect(m_edit, &QPushButton::clicked, this, &GitLabOptionsWidget::showEditServerDialog);

View File

@@ -81,7 +81,7 @@ MacroOptionsWidget::MacroOptionsWidget()
Title(tr("Preferences")),
Row {
m_treeWidget,
Column { m_removeButton, Stretch() },
Column { m_removeButton, st },
}
},
m_macroGroup

View File

@@ -53,8 +53,8 @@ SaveDialog::SaveDialog(QWidget *parent) :
using namespace Layouting;
Form {
tr("Name:"), m_name, Break(),
tr("Description:"), m_description, Break(),
tr("Name:"), m_name, br,
tr("Description:"), m_description, br,
buttonBox
}.attachTo(this);

View File

@@ -98,11 +98,11 @@ MercurialSettingsPage::MercurialSettingsPage(MercurialSettings *settings)
Row {
s.logCount,
s.timeout,
Stretch()
st
}
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -71,7 +71,7 @@ GeneralSettingsPage::GeneralSettingsPage()
Column {
s.autorunMeson,
s.verboseNinja,
Stretch(),
st,
}.attachTo(widget);
});
}

View File

@@ -145,7 +145,7 @@ NimToolsSettingsPage::NimToolsSettingsPage(NimSettings *settings)
Title("Nimsuggest"),
Column { settings->nimSuggestPath }
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -278,7 +278,7 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings)
Group misc {
Title(PerforceSettings::tr("Miscellaneous")),
Column {
Row { s.logCount, s.timeOutS, Stretch() },
Row { s.logCount, s.timeOutS, st },
s.promptToSubmit,
s.autoOpen
}
@@ -288,8 +288,8 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings)
config,
environment,
misc,
Row { errorLabel, Stretch(), testButton },
Stretch()
Row { errorLabel, st, testButton },
st
}.attachTo(widget);
});
}

View File

@@ -109,20 +109,18 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault);
using namespace Layouting;
const Break nl;
Column {
Row { Stretch(), useTracePointsButton, addEventButton, removeEventButton, resetButton },
Row { st, useTracePointsButton, addEventButton, removeEventButton, resetButton },
eventsView,
Grid {
m_settings->callgraphMode, m_settings->stackSize, nl,
m_settings->sampleMode, m_settings->period, nl,
m_settings->callgraphMode, m_settings->stackSize, br,
m_settings->sampleMode, m_settings->period, br,
m_settings->extraArguments,
},
Stretch()
st
}.attachTo(this);
}

View File

@@ -79,11 +79,11 @@ PerfLoadDialog::PerfLoadDialog(QWidget *parent)
Column {
Grid {
label1, m_traceFileLineEdit, browseTraceFileButton, Break(),
label2, m_executableDirLineEdit, browseExecutableDirButton, Break(),
label1, m_traceFileLineEdit, browseTraceFileButton, br,
label2, m_executableDirLineEdit, browseExecutableDirButton, br,
label3, Span(2, m_kitChooser)
},
Stretch(),
st,
line,
buttonBox
}.attachTo(this);

View File

@@ -119,7 +119,7 @@ BuildPropertiesSettingsPage::BuildPropertiesSettingsPage(BuildPropertiesSettings
s.qmlDebugging,
s.qtQuickCompiler
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -70,7 +70,7 @@ CodeStyleSettingsWidget::CodeStyleSettingsWidget(Project *project)
using namespace Utils::Layouting;
Column {
Row { new QLabel(tr("Language:")), languageComboBox, Stretch() },
Row { new QLabel(tr("Language:")), languageComboBox, st },
stackedWidget
}.attachTo(this, false);
}

View File

@@ -72,14 +72,14 @@ EditorSettingsWidget::EditorSettingsWidget(Project *project) : m_project(project
m_showWrapColumn,
m_wrapColumn,
m_useIndenter,
Stretch()
st
}.attachTo(m_displaySettings);
Column {
Row { m_restoreButton, Stretch() },
Row { m_restoreButton, st },
m_displaySettings,
m_behaviorSettings,
Stretch(),
st,
}.attachTo(this, false);
const EditorConfiguration *config = m_project->editorConfiguration();

View File

@@ -88,7 +88,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
using namespace Layouting;
Grid {
AlignAsFormLabel(label), m_nameEdit, m_iconButton, Break(),
AlignAsFormLabel(label), m_nameEdit, m_iconButton, br,
AlignAsFormLabel(label), m_fileSystemFriendlyNameLineEdit
}.attachTo(this);

View File

@@ -112,7 +112,7 @@ public:
connect(m_executable, &PathChooser::filePathChanged, this, &InterpreterDetailsWidget::changed);
Form {
Tr::tr("Name:"), m_name, Break(),
Tr::tr("Name:"), m_name, br,
Tr::tr("Executable"), m_executable
}.attachTo(this, false);
}
@@ -221,7 +221,7 @@ InterpreterOptionsWidget::InterpreterOptionsWidget(const QList<Interpreter> &int
m_deleteButton,
m_makeDefaultButton,
m_cleanButton,
Stretch()
st
};
Column {

View File

@@ -105,7 +105,7 @@ public:
s.m_warnAgainstUnalignedBuildDir,
s.m_alwaysRunQmake,
s.m_ignoreSystemFunction,
Stretch()
st
}.attachTo(this);
}

View File

@@ -103,22 +103,22 @@ QnxSettingsWidget::QnxSettingsWidget()
Row {
Column {
m_configsCombo,
Row { m_generateKitsCheckBox, Stretch() },
Row { m_generateKitsCheckBox, st },
Group {
Title(Tr::tr("Configuration Information:")),
Form {
Tr::tr("Name:"), m_configName, Break(),
Tr::tr("Version:"), m_configVersion, Break(),
Tr::tr("Host:"), m_configHost, Break(),
Tr::tr("Name:"), m_configName, br,
Tr::tr("Version:"), m_configVersion, br,
Tr::tr("Host:"), m_configHost, br,
Tr::tr("Target:"), m_configTarget
}
},
Stretch()
st
},
Column {
addButton,
removeButton,
Stretch()
st
}
}.attachTo(this);

View File

@@ -108,7 +108,7 @@ CodeGenSettingsPageWidget::CodeGenSettingsPageWidget()
m_addQtVersionCheckBox
}
},
Stretch()
st
}.attachTo(this);
connect(m_includeQtModuleCheckBox, &QAbstractButton::toggled,

View File

@@ -290,15 +290,9 @@ QtOptionsPageWidget::QtOptionsPageWidget()
auto versionInfoWidget = new QWidget;
Form {
new QLabel(tr("Name:")), m_nameEdit, Break(),
new QLabel(tr("qmake path:")),
Row {
m_qmakePath,
m_editPathPushButton,
},
Break(),
tr("Name:"), m_nameEdit, br,
tr("qmake path:"), Row { m_qmakePath, m_editPathPushButton }, br,
Span(2, m_errorLabel)
}.attachTo(versionInfoWidget, false);
m_formLayout = qobject_cast<QFormLayout*>(versionInfoWidget->layout());
@@ -308,11 +302,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
m_qtdirList,
m_versionInfoWidget,
m_infoWidget,
Row {
new QLabel(tr("Register documentation:")),
m_documentationSetting,
Stretch()
}
Row { tr("Register documentation:"), m_documentationSetting, st }
},
Column {
@@ -321,7 +311,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
Space(20),
m_linkWithQtButton,
m_cleanUpButton,
Stretch()
st,
}
}.attachTo(this);

View File

@@ -98,17 +98,15 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget(
sshPortLabel->setBuddy(m_sshPortSpinBox);
using namespace Layouting;
const Break nl;
const Stretch st;
Form {
Tr::tr("Machine type:"), m_machineTypeValueLabel, st, nl,
Tr::tr("Authentication type:"), m_defaultAuthButton, m_keyButton, st, nl,
Tr::tr("&Host name:"), m_hostLineEdit, sshPortLabel, m_sshPortSpinBox, m_hostKeyCheckBox, st, nl,
Tr::tr("Free ports:"), m_portsLineEdit, m_portsWarningLabel, Tr::tr("Timeout:"), m_timeoutSpinBox, st, nl,
Tr::tr("&Username:"), m_userLineEdit, st, nl,
m_keyLabel, m_keyFileLineEdit, createKeyButton, st, nl,
Tr::tr("GDB server executable:"), m_gdbServerLineEdit, st, nl
Tr::tr("Machine type:"), m_machineTypeValueLabel, st, br,
Tr::tr("Authentication type:"), m_defaultAuthButton, m_keyButton, st, br,
Tr::tr("&Host name:"), m_hostLineEdit, sshPortLabel, m_sshPortSpinBox, m_hostKeyCheckBox, st, br,
Tr::tr("Free ports:"), m_portsLineEdit, m_portsWarningLabel, Tr::tr("Timeout:"), m_timeoutSpinBox, st, br,
Tr::tr("&Username:"), m_userLineEdit, st, br,
m_keyLabel, m_keyFileLineEdit, createKeyButton, st, br,
Tr::tr("GDB server executable:"), m_gdbServerLineEdit, st, br
}.attachTo(this);
connect(m_hostLineEdit, &QLineEdit::editingFinished,

View File

@@ -77,13 +77,10 @@ GenericLinuxDeviceConfigurationWizardSetupPage::GenericLinuxDeviceConfigurationW
d->userNameLineEdit = new QLineEdit(this);
using namespace Layouting;
const Break nl;
const Stretch st;
Form {
Tr::tr("The name to identify this configuration:"), d->nameLineEdit, nl,
Tr::tr("The device's host name or IP address:"), d->hostNameLineEdit, st, nl,
Tr::tr("The username to log into the device:"), d->userNameLineEdit, st, nl
Tr::tr("The name to identify this configuration:"), d->nameLineEdit, br,
Tr::tr("The device's host name or IP address:"), d->hostNameLineEdit, st, br,
Tr::tr("The username to log into the device:"), d->userNameLineEdit, st, br
}.attachTo(this);
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)

View File

@@ -71,20 +71,17 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
auto closeButton = new QPushButton(Tr::tr("&Cancel"));
using namespace Layouting;
const Break nl;
const Stretch st;
Column {
Group {
Title(Tr::tr("Options")),
Form {
Tr::tr("Key algorithm:"), m_rsa, m_ecdsa, st, nl,
Tr::tr("Key &size:"), m_comboBox, st, nl,
Tr::tr("Private key file:"), m_privateKeyFileValueLabel, privateKeyFileButton, st, nl,
Tr::tr("Key algorithm:"), m_rsa, m_ecdsa, st, br,
Tr::tr("Key &size:"), m_comboBox, st, br,
Tr::tr("Private key file:"), m_privateKeyFileValueLabel, privateKeyFileButton, st, br,
Tr::tr("Public key file:"), m_publicKeyFileLabel
}
},
Stretch(),
st,
Row { m_generateButton, closeButton, st }
}.attachTo(this);

View File

@@ -118,13 +118,13 @@ void ObjectsMapEditorWidget::initUi()
m_newProperty,
m_removeProperty,
m_jumpToSymbolicName,
Stretch()
st
}
}.attachTo(validPropertiesWidget);
Column {
m_propertiesLineEdit,
Stretch()
st
}.attachTo(invalidPropertiesWidget);
Column {
@@ -135,7 +135,7 @@ void ObjectsMapEditorWidget::initUi()
Column {
m_newSymbolicName,
m_removeSymbolicName,
Stretch(),
st,
}
},
m_propertiesLabel,

View File

@@ -76,7 +76,7 @@ OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
Column {
selectAllPushButton,
deselectAllPushButton,
Stretch()
st
}
},
m_buttonBox

View File

@@ -113,15 +113,13 @@ SquishSettingsPage::SquishSettingsPage(SquishSettings *settings)
SquishSettings &s = *settings;
using namespace Layouting;
const Break nl;
Grid grid {
s.squishPath, nl,
s.licensePath, nl,
Span {2, Row { s.local, s.serverHost, s.serverPort } }, nl,
s.verbose, nl,
s.squishPath, br,
s.licensePath, br,
Span {2, Row { s.local, s.serverHost, s.serverPort } }, br,
s.verbose, br,
};
Column { Row { grid }, Stretch() }.attachTo(widget);
Column { Row { grid }, st }.attachTo(widget);
});
}
@@ -311,14 +309,14 @@ SquishServerSettingsWidget::SquishServerSettingsWidget(QWidget *parent)
using namespace Layouting;
Form grid {
&m_applicationsView, Break(),
&m_applicationsView, br,
&m_serverSettings.autTimeout,
&m_serverSettings.responseTimeout,
&m_serverSettings.postMortemWaitTime,
&m_serverSettings.animatedCursor,
};
// TODO buttons for add, edit, remove
Column { Row { grid }, Stretch() }.attachTo(this);
Column { Row { grid }, st }.attachTo(this);
repopulateApplicationView(); // initial

View File

@@ -136,13 +136,13 @@ SubversionSettingsPage::SubversionSettingsPage(SubversionSettings *settings)
Group {
Title(SubversionSettings::tr("Miscellaneous")),
Column {
Row { s.logCount, s.timeout, Stretch() },
Row { s.logCount, s.timeout, st },
s.promptOnSubmit,
s.spaceIgnorantAnnotation,
}
},
Stretch()
st
}.attachTo(widget);
});
}

View File

@@ -107,7 +107,7 @@ OptionsDialog::OptionsDialog(Settings *settings, const std::function<void ()> &o
m_editKeywordButton,
m_removeKeywordButton,
resetKeywordsButton,
Stretch()
st
}
}
},

View File

@@ -64,7 +64,7 @@ TodoProjectSettingsWidget::TodoProjectSettingsWidget(ProjectExplorer::Project *p
Column {
addExcludedPatternButton,
m_removeExcludedPatternButton,
Stretch()
st
}
}
}

View File

@@ -76,10 +76,10 @@ public:
m_infoLabel,
Row {
Form {
new QLabel(tr("Check interval basis:")), m_checkIntervalComboBox, Break(),
new QLabel(tr("Check interval basis:")), m_checkIntervalComboBox, br,
new QLabel(tr("Next check date:")), m_nextCheckDateLabel
},
Stretch()
st
},
m_checkForNewQtVersions
}.attachTo(m_updatesGroupBox);
@@ -95,14 +95,14 @@ public:
Row {
new QLabel(tr("Last check date:")),
m_lastCheckDateLabel,
Stretch(),
st,
Row {
m_messageLabel,
Stretch(),
st,
m_checkNowButton
}
},
Stretch()
st
}.attachTo(this);
m_checkIntervalComboBox->setCurrentIndex(-1);

View File

@@ -61,31 +61,30 @@ public:
ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings)
{
using namespace Layouting;
const Break nl;
ValgrindBaseSettings &s = *settings;
Grid generic {
s.valgrindExecutable, nl,
s.valgrindArguments, nl,
s.selfModifyingCodeDetection, nl
s.valgrindExecutable, br,
s.valgrindArguments, br,
s.selfModifyingCodeDetection, br
};
Grid memcheck {
s.memcheckArguments, nl,
s.trackOrigins, nl,
s.showReachable, nl,
s.leakCheckOnFinish, nl,
s.numCallers, nl,
s.filterExternalIssues, nl,
s.memcheckArguments, br,
s.trackOrigins, br,
s.showReachable, br,
s.leakCheckOnFinish, br,
s.numCallers, br,
s.filterExternalIssues, br,
s.suppressions
};
Grid callgrind {
s.callgrindArguments, nl,
s.kcachegrindExecutable, nl,
s.minimumInclusiveCostRatio, nl,
s.visualizationMinimumInclusiveCostRatio, nl,
s.enableEventToolTips, nl,
s.callgrindArguments, br,
s.kcachegrindExecutable, br,
s.minimumInclusiveCostRatio, br,
s.visualizationMinimumInclusiveCostRatio, br,
s.enableEventToolTips, br,
Span {
2,
Group {
@@ -103,7 +102,7 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings)
Group { Title(Tr::tr("Valgrind Generic Settings")), generic },
Group { Title(Tr::tr("MemCheck Memory Analysis Options")), memcheck },
Group { Title(Tr::tr("CallGrind Profiling Options")), callgrind },
Stretch(),
st,
}.attachTo(this);
}

View File

@@ -173,10 +173,10 @@ void SuppressionAspect::addToLayout(LayoutBuilder &builder)
connect(d->entryList->selectionModel(), &QItemSelectionModel::selectionChanged,
d, &SuppressionAspectPrivate::slotSuppressionSelectionChanged);
builder.addItem(Column { new QLabel(Tr::tr("Suppression files:")), Stretch() });
builder.addItem(Column { Tr::tr("Suppression files:"), st });
Row group {
d->entryList.data(),
Column { d->addEntry.data(), d->removeEntry.data(), Stretch() }
Column { d->addEntry.data(), d->removeEntry.data(), st }
};
builder.addItem(Span { 2, group });

View File

@@ -138,7 +138,7 @@ CommonSettingsWidget::CommonSettingsWidget(CommonOptionsPage *page)
using namespace Layouting;
Column {
Row { s.lineWrap, s.lineWrapWidth, Stretch() },
Row { s.lineWrap, s.lineWrapWidth, st },
Form {
s.submitMessageCheckScript,
s.nickNameMailMap,