diff options
author | hjk <hjk@qt.io> | 2022-07-22 18:54:04 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-07-25 09:52:15 +0000 |
commit | 14257a24f949339758e0b83572b22f8bd810647a (patch) | |
tree | 42472fb7e54fb0dbd325ef353ee0af841d477501 | |
parent | 80aef9c0ef13200773490528830141a79a2a2c0c (diff) | |
download | qt-creator-14257a24f949339758e0b83572b22f8bd810647a.tar.gz |
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>
71 files changed, 211 insertions, 254 deletions
diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index 89cd47d75a..1b0dd064f7 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -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, diff --git a/src/libs/utils/layoutbuilder.cpp b/src/libs/utils/layoutbuilder.cpp index aaa009910d..1214562405 100644 --- a/src/libs/utils/layoutbuilder.cpp +++ b/src/libs/utils/layoutbuilder.cpp @@ -509,5 +509,8 @@ LayoutBuilder::Setter title(const QString &title, BoolAspect *checker) }; } +LayoutBuilder::Break br; +LayoutBuilder::Stretch st; + } // Layouting } // Utils diff --git a/src/libs/utils/layoutbuilder.h b/src/libs/utils/layoutbuilder.h index 4c345fb37c..68cf663d6d 100644 --- a/src/libs/utils/layoutbuilder.h +++ b/src/libs/utils/layoutbuilder.h @@ -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 diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index c8f99d7bb7..3a2d94c446 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -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); diff --git a/src/plugins/android/androidcreatekeystorecertificate.cpp b/src/plugins/android/androidcreatekeystorecertificate.cpp index 1248b859b7..6506b857a2 100644 --- a/src/plugins/android/androidcreatekeystorecertificate.cpp +++ b/src/plugins/android/androidcreatekeystorecertificate.cpp @@ -99,7 +99,6 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close|QDialogButtonBox::Save); using namespace Layouting; - const Break br; Column { Group { diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp index 7d25eb8f1a..bde5154888 100644 --- a/src/plugins/android/androidsdkmanagerwidget.cpp +++ b/src/plugins/android/androidsdkmanagerwidget.cpp @@ -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, diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index d4e0daff97..35ab12be02 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -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, diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp index 852fa8a7bc..4180f0ec88 100644 --- a/src/plugins/android/avddialog.cpp +++ b/src/plugins/android/avddialog.cpp @@ -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); diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestsettings.cpp index a32899d022..c70c1c1308 100644 --- a/src/plugins/autotest/boost/boosttestsettings.cpp +++ b/src/plugins/autotest/boost/boosttestsettings.cpp @@ -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); }); } diff --git a/src/plugins/autotest/catch/catchtestsettings.cpp b/src/plugins/autotest/catch/catchtestsettings.cpp index 358ff85fd4..28d09590ec 100644 --- a/src/plugins/autotest/catch/catchtestsettings.cpp +++ b/src/plugins/autotest/catch/catchtestsettings.cpp @@ -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); }); } diff --git a/src/plugins/autotest/ctest/ctestsettings.cpp b/src/plugins/autotest/ctest/ctestsettings.cpp index 88ac6335a0..83f73961c5 100644 --- a/src/plugins/autotest/ctest/ctestsettings.cpp +++ b/src/plugins/autotest/ctest/ctestsettings.cpp @@ -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); }); } diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp index e6eabe35a1..14d72f826b 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestsettings.cpp @@ -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); }); } diff --git a/src/plugins/autotest/qtest/qttestsettings.cpp b/src/plugins/autotest/qtest/qttestsettings.cpp index 24e2f34629..d48224003d 100644 --- a/src/plugins/autotest/qtest/qttestsettings.cpp +++ b/src/plugins/autotest/qtest/qttestsettings.cpp @@ -138,7 +138,7 @@ QtTestSettingsPage::QtTestSettingsPage(QtTestSettings *settings, Id settingsId) }, }; - Column { Row { col, Stretch() }, Stretch() }.attachTo(widget); + Column { Row { col, st }, st }.attachTo(widget); }); } diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index afb985c2cd..b60abfeb9c 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -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, diff --git a/src/plugins/bazaar/bazaarsettings.cpp b/src/plugins/bazaar/bazaarsettings.cpp index d39d5758ec..f092f32b01 100644 --- a/src/plugins/bazaar/bazaarsettings.cpp +++ b/src/plugins/bazaar/bazaarsettings.cpp @@ -123,11 +123,10 @@ BazaarSettingsPage::BazaarSettingsPage(BazaarSettings *settings) Row { s.logCount, s.timeout, - Stretch() + st } }, - Stretch() - + st }.attachTo(widget); }); } diff --git a/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.cpp b/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.cpp index 563c4516db..3de80a5400 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.cpp @@ -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); diff --git a/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp b/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp index 77679fd925..aa389aaa66 100644 --- a/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp +++ b/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp @@ -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); diff --git a/src/plugins/beautifier/generaloptionspage.cpp b/src/plugins/beautifier/generaloptionspage.cpp index f00121718b..7eb5ec9eaf 100644 --- a/src/plugins/beautifier/generaloptionspage.cpp +++ b/src/plugins/beautifier/generaloptionspage.cpp @@ -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); diff --git a/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.cpp b/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.cpp index 5485ec68ba..855b8c1022 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.cpp @@ -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); diff --git a/src/plugins/clangtools/clangtoolsprojectsettingswidget.cpp b/src/plugins/clangtools/clangtoolsprojectsettingswidget.cpp index 813fb0ebde..d137d24af6 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettingswidget.cpp +++ b/src/plugins/clangtools/clangtoolsprojectsettingswidget.cpp @@ -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 } } } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 899a8180e6..196c6ffdbd 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -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 } }; diff --git a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp index 1d1ebb99a3..b4d2b62d3b 100644 --- a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp +++ b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp @@ -102,7 +102,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett s.packageManagerAutoSetup, s.askBeforeReConfigureInitialParams, s.showSourceSubFolders, - Stretch(), + st }.attachTo(widget); }); } diff --git a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp index 9da525a9bd..b2b259b588 100644 --- a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp +++ b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp @@ -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); diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 5769f3273d..91dc810885 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -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(); diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index af1816927b..6366e85db9 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -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}; diff --git a/src/plugins/coreplugin/locator/urllocatorfilter.cpp b/src/plugins/coreplugin/locator/urllocatorfilter.cpp index ae94ee4428..bf802e3205 100644 --- a/src/plugins/coreplugin/locator/urllocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/urllocatorfilter.cpp @@ -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 }; diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index a49c7bf7f5..898ece4599 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -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); diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index 71479ee0bb..305356289c 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -71,11 +71,11 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSe Column { Form { - label, Break(), + label, br, s.path, s.displayCount }, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/cpaster/settings.cpp b/src/plugins/cpaster/settings.cpp index a27e9876f9..7424e644e7 100644 --- a/src/plugins/cpaster/settings.cpp +++ b/src/plugins/cpaster/settings.cpp @@ -94,7 +94,7 @@ SettingsPage::SettingsPage(Settings *settings) }, s.copyToClipboard, s.displayOutput, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 30a948e7f9..c9d3b78088 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -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); } diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index f3effb0816..4a27ca5509 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -121,7 +121,7 @@ CvsSettingsPage::CvsSettingsPage(CvsSettings *settings) s.describeByCommitId, } }, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp index 02a2769404..d84425731f 100644 --- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp +++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp @@ -56,7 +56,7 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec details->setWidget(innerPane); Column { - Row { settingsCombo, restoreButton, Stretch() }, + Row { settingsCombo, restoreButton, st }, configWidget }.attachTo(innerPane); diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index b7fb6e36e7..bbfd374097 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -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); } diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 66dad3d1a7..da870409f8 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -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); } diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 089a8dfd25..dadd708075 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -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); }); } }; diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 0086178b2b..b552cb4ad5 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -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); diff --git a/src/plugins/docker/dockersettings.cpp b/src/plugins/docker/dockersettings.cpp index bd5c5d9e8b..ff405303f0 100644 --- a/src/plugins/docker/dockersettings.cpp +++ b/src/plugins/docker/dockersettings.cpp @@ -75,7 +75,7 @@ DockerSettingsPage::DockerSettingsPage(DockerSettings *settings) Title(Tr::tr("Configuration")), Row { s.dockerBinaryPath } }, - Stretch() + st }.attachTo(widget); // clang-format on }); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 6728a0f9d1..1e85113c1f 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -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); diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index b0836ab54d..6ff4841144 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -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); }); } diff --git a/src/plugins/gitlab/gitlabdialog.cpp b/src/plugins/gitlab/gitlabdialog.cpp index 1791327168..440ba9c7da 100644 --- a/src/plugins/gitlab/gitlabdialog.cpp +++ b/src/plugins/gitlab/gitlabdialog.cpp @@ -118,7 +118,6 @@ GitLabDialog::GitLabDialog(QWidget *parent) buttonBox->addButton(m_clonePB, QDialogButtonBox::ActionRole); using namespace Layouting; - const Stretch st; Column { Row { diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp index 97f9d569d5..c7067c0a18 100644 --- a/src/plugins/gitlab/gitlaboptionspage.cpp +++ b/src/plugins/gitlab/gitlaboptionspage.cpp @@ -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); diff --git a/src/plugins/macros/macrooptionswidget.cpp b/src/plugins/macros/macrooptionswidget.cpp index b802225400..46ac3b4e51 100644 --- a/src/plugins/macros/macrooptionswidget.cpp +++ b/src/plugins/macros/macrooptionswidget.cpp @@ -81,7 +81,7 @@ MacroOptionsWidget::MacroOptionsWidget() Title(tr("Preferences")), Row { m_treeWidget, - Column { m_removeButton, Stretch() }, + Column { m_removeButton, st }, } }, m_macroGroup diff --git a/src/plugins/macros/savedialog.cpp b/src/plugins/macros/savedialog.cpp index f5968bf9d4..87721a997a 100644 --- a/src/plugins/macros/savedialog.cpp +++ b/src/plugins/macros/savedialog.cpp @@ -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); diff --git a/src/plugins/mercurial/mercurialsettings.cpp b/src/plugins/mercurial/mercurialsettings.cpp index 018f6594e1..6cc7c17cb5 100644 --- a/src/plugins/mercurial/mercurialsettings.cpp +++ b/src/plugins/mercurial/mercurialsettings.cpp @@ -98,11 +98,11 @@ MercurialSettingsPage::MercurialSettingsPage(MercurialSettings *settings) Row { s.logCount, s.timeout, - Stretch() + st } }, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/mesonprojectmanager/settings/general/settings.cpp b/src/plugins/mesonprojectmanager/settings/general/settings.cpp index 694f8b063b..3cdbabd936 100644 --- a/src/plugins/mesonprojectmanager/settings/general/settings.cpp +++ b/src/plugins/mesonprojectmanager/settings/general/settings.cpp @@ -71,7 +71,7 @@ GeneralSettingsPage::GeneralSettingsPage() Column { s.autorunMeson, s.verboseNinja, - Stretch(), + st, }.attachTo(widget); }); } diff --git a/src/plugins/nim/settings/nimsettings.cpp b/src/plugins/nim/settings/nimsettings.cpp index 85b68a1415..5ba09a8d39 100644 --- a/src/plugins/nim/settings/nimsettings.cpp +++ b/src/plugins/nim/settings/nimsettings.cpp @@ -145,7 +145,7 @@ NimToolsSettingsPage::NimToolsSettingsPage(NimSettings *settings) Title("Nimsuggest"), Column { settings->nimSuggestPath } }, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index 78f95cc76c..785e387706 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -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); }); } diff --git a/src/plugins/perfprofiler/perfconfigwidget.cpp b/src/plugins/perfprofiler/perfconfigwidget.cpp index f52bebc485..3ab599e0bf 100644 --- a/src/plugins/perfprofiler/perfconfigwidget.cpp +++ b/src/plugins/perfprofiler/perfconfigwidget.cpp @@ -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); } diff --git a/src/plugins/perfprofiler/perfloaddialog.cpp b/src/plugins/perfprofiler/perfloaddialog.cpp index 14eb53d1d4..a67ba62343 100644 --- a/src/plugins/perfprofiler/perfloaddialog.cpp +++ b/src/plugins/perfprofiler/perfloaddialog.cpp @@ -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); diff --git a/src/plugins/projectexplorer/buildpropertiessettings.cpp b/src/plugins/projectexplorer/buildpropertiessettings.cpp index f229d9c37a..ce3f5a9c7f 100644 --- a/src/plugins/projectexplorer/buildpropertiessettings.cpp +++ b/src/plugins/projectexplorer/buildpropertiessettings.cpp @@ -119,7 +119,7 @@ BuildPropertiesSettingsPage::BuildPropertiesSettingsPage(BuildPropertiesSettings s.qmlDebugging, s.qtQuickCompiler }, - Stretch() + st }.attachTo(widget); }); } diff --git a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp index 53ee0ff9d8..6688c67f9b 100644 --- a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp @@ -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); } diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp index bd20a2f6c8..4bccf6ebc1 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.cpp @@ -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(); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index b5bda5f573..d3041ee771 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -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); diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index fabcb4e8f6..dd5ed4c24a 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -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 { diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.cpp b/src/plugins/qmakeprojectmanager/qmakesettings.cpp index 8102ce1081..362d34f7a2 100644 --- a/src/plugins/qmakeprojectmanager/qmakesettings.cpp +++ b/src/plugins/qmakeprojectmanager/qmakesettings.cpp @@ -105,7 +105,7 @@ public: s.m_warnAgainstUnalignedBuildDir, s.m_alwaysRunQmake, s.m_ignoreSystemFunction, - Stretch() + st }.attachTo(this); } diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp index 50be719ab5..93db385545 100644 --- a/src/plugins/qnx/qnxsettingspage.cpp +++ b/src/plugins/qnx/qnxsettingspage.cpp @@ -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); diff --git a/src/plugins/qtsupport/codegensettingspage.cpp b/src/plugins/qtsupport/codegensettingspage.cpp index 1d86bba170..c7c26ad14a 100644 --- a/src/plugins/qtsupport/codegensettingspage.cpp +++ b/src/plugins/qtsupport/codegensettingspage.cpp @@ -108,7 +108,7 @@ CodeGenSettingsPageWidget::CodeGenSettingsPageWidget() m_addQtVersionCheckBox } }, - Stretch() + st }.attachTo(this); connect(m_includeQtModuleCheckBox, &QAbstractButton::toggled, diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 349375d2cf..09c053daed 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -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); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index e32909693f..cfd690b42a 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -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, diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp index 565c7c10fa..d25015a929 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp @@ -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) diff --git a/src/plugins/remotelinux/sshkeycreationdialog.cpp b/src/plugins/remotelinux/sshkeycreationdialog.cpp index 74ddad4cd7..7599b42cb2 100644 --- a/src/plugins/remotelinux/sshkeycreationdialog.cpp +++ b/src/plugins/remotelinux/sshkeycreationdialog.cpp @@ -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); diff --git a/src/plugins/squish/objectsmapeditorwidget.cpp b/src/plugins/squish/objectsmapeditorwidget.cpp index 40a2fe0342..0a62e4f4e6 100644 --- a/src/plugins/squish/objectsmapeditorwidget.cpp +++ b/src/plugins/squish/objectsmapeditorwidget.cpp @@ -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, diff --git a/src/plugins/squish/opensquishsuitesdialog.cpp b/src/plugins/squish/opensquishsuitesdialog.cpp index ba37580bd1..9fccd227b9 100644 --- a/src/plugins/squish/opensquishsuitesdialog.cpp +++ b/src/plugins/squish/opensquishsuitesdialog.cpp @@ -76,7 +76,7 @@ OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent) Column { selectAllPushButton, deselectAllPushButton, - Stretch() + st } }, m_buttonBox diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index c860dc53c4..2ef4eaa5ff 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -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 diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index 19be4970ac..3c6ac4a950 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -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); }); } diff --git a/src/plugins/todo/optionsdialog.cpp b/src/plugins/todo/optionsdialog.cpp index dee4b15c13..e3ffea1e4b 100644 --- a/src/plugins/todo/optionsdialog.cpp +++ b/src/plugins/todo/optionsdialog.cpp @@ -107,7 +107,7 @@ OptionsDialog::OptionsDialog(Settings *settings, const std::function<void ()> &o m_editKeywordButton, m_removeKeywordButton, resetKeywordsButton, - Stretch() + st } } }, diff --git a/src/plugins/todo/todoprojectsettingswidget.cpp b/src/plugins/todo/todoprojectsettingswidget.cpp index 3851390fb9..d3c12b2ebc 100644 --- a/src/plugins/todo/todoprojectsettingswidget.cpp +++ b/src/plugins/todo/todoprojectsettingswidget.cpp @@ -64,7 +64,7 @@ TodoProjectSettingsWidget::TodoProjectSettingsWidget(ProjectExplorer::Project *p Column { addExcludedPatternButton, m_removeExcludedPatternButton, - Stretch() + st } } } diff --git a/src/plugins/updateinfo/settingspage.cpp b/src/plugins/updateinfo/settingspage.cpp index 7cc9a72a43..2aa7eef93f 100644 --- a/src/plugins/updateinfo/settingspage.cpp +++ b/src/plugins/updateinfo/settingspage.cpp @@ -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); diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp index dfaa87a5a8..25553c528a 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.cpp +++ b/src/plugins/valgrind/valgrindconfigwidget.cpp @@ -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); } diff --git a/src/plugins/valgrind/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp index c2e9934255..aab571a89f 100644 --- a/src/plugins/valgrind/valgrindsettings.cpp +++ b/src/plugins/valgrind/valgrindsettings.cpp @@ -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 }); diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index 9d6fa1dce4..90ced3f150 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -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, |