Remove usages of deprecated APIs of QLayout

Replaced:
  QLayout::setMargin() -> QLayout::setContentsMargins()
  QLayout::margin() -> QLayout::getContentsMargins()

Task-number: QTBUG-76491
Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Sona Kurazyan
2019-08-29 10:36:01 +02:00
parent 228f5fc319
commit 8e31932c29
117 changed files with 177 additions and 181 deletions
@@ -158,7 +158,6 @@ void DragWidget::enterEvent(QEvent *)
ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_currentWidget(nullptr)
{
QGridLayout *layout = new QGridLayout(this);
layout->setMargin(0);
layout->setContentsMargins(1, 1, 1, 1);
layout->setSpacing(0);
m_toolButton = new QToolButton(this);
@@ -884,7 +884,6 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent)
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *horizontalLayout = new QHBoxLayout();
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
layout->setMargin(0);
layout->setContentsMargins(2, 2, 2, 16);
layout->setSpacing(4);
QToolButton *toolButton = new QToolButton(this);
@@ -62,8 +62,7 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
QVBoxLayout* vBox = new QVBoxLayout(colorFrameWidget);
colorFrameWidget->setLayout(vBox);
vBox->setSpacing(0);
vBox->setMargin(0);
vBox->setContentsMargins(0,5,0,28);
vBox->setContentsMargins(0, 5, 0, 28);
m_beforeColorWidget = new QFrame(colorFrameWidget);
m_beforeColorWidget->setFixedSize(30, 18);
@@ -85,7 +84,7 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
QGridLayout *gridLayout = new QGridLayout(this);
gridLayout->setSpacing(4);
gridLayout->setVerticalSpacing(4);
gridLayout->setMargin(4);
gridLayout->setContentsMargins(4, 4, 4, 4);
setLayout(gridLayout);
gridLayout->addWidget(m_colorBox, 0, 0, 4, 1);
+1 -1
View File
@@ -182,7 +182,7 @@ public:
m_maximumActiveSize = QSize(maxWidth, activeHeight);
auto layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->setContentsMargins(4, 0, 0, 0);
layout->addWidget(m_titleLabel);
+3 -1
View File
@@ -121,7 +121,9 @@ QSize FlowLayout::minimumSize() const
foreach (item, itemList)
size = size.expandedTo(item->minimumSize());
size += QSize(2*margin(), 2*margin());
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
size += QSize(left + right, top + bottom);
return size;
}
+1 -1
View File
@@ -61,7 +61,7 @@ NameValueItemsWidget::NameValueItemsWidget(QWidget *parent)
{
m_editor = new QPlainTextEdit(this);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_editor);
}
+1 -1
View File
@@ -110,7 +110,7 @@ PathListEditorPrivate::PathListEditorPrivate() :
buttonLayout(new QVBoxLayout),
edit(new PathListPlainTextEdit)
{
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(edit);
layout->addLayout(buttonLayout);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored,
+1 -1
View File
@@ -66,7 +66,7 @@ public:
m_indicatorLabel->setFixedSize(m_indicatorPixmap.size());
m_titleLabel = new QLabel(title, this);
auto l = new QHBoxLayout(this);
l->setMargin(0);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(m_indicatorLabel);
l->addWidget(m_titleLabel);
}
@@ -165,7 +165,7 @@ void AndroidManifestEditorWidget::initializePage()
m_packageNameWarningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
auto warningRow = new QHBoxLayout;
warningRow->setMargin(0);
warningRow->setContentsMargins(0, 0, 0, 0);
warningRow->addWidget(m_packageNameWarningIcon);
warningRow->addWidget(m_packageNameWarning);
+1 -1
View File
@@ -91,7 +91,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
setWidget(mainWidget);
auto layout = new QGridLayout(mainWidget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto label = new QLabel;
label->setText(tr("%1 needs additional settings to enable Android support."
" You can configure those settings in the Options dialog.")
@@ -103,7 +103,7 @@ public:
{
QTC_CHECK(m_detailsWidget);
auto layout = new QGridLayout(this);
layout->setMargin(12);
layout->setContentsMargins(12, 12, 12, 12);
int row = 0;
for (auto itr = validationPoints.cbegin(); itr != validationPoints.cend(); ++itr) {
RowData data;
@@ -235,7 +235,7 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_sdkManagerWidget = new AndroidSdkManagerWidget(m_androidConfig, m_sdkManager.get(),
m_ui->sdkManagerTab);
auto sdkMangerLayout = new QVBoxLayout(m_ui->sdkManagerTab);
sdkMangerLayout->setMargin(0);
sdkMangerLayout->setContentsMargins(0, 0, 0, 0);
sdkMangerLayout->addWidget(m_sdkManagerWidget);
connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::updatingSdk, [this]() {
m_ui->SDKLocationPathChooser->setEnabled(false);
@@ -78,7 +78,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
hLayout->addWidget(new QLabel(tr("No active test frameworks.")));
m_missingFrameworksWidget->setVisible(!TestFrameworkManager::instance()->hasActiveFrameworks());
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_missingFrameworksWidget);
layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_view));
+2 -2
View File
@@ -89,7 +89,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
QWidget *visualOutputWidget = new QWidget;
m_outputWidget->addWidget(visualOutputWidget);
QVBoxLayout *outputLayout = new QVBoxLayout;
outputLayout->setMargin(0);
outputLayout->setContentsMargins(0, 0, 0, 0);
outputLayout->setSpacing(0);
visualOutputWidget->setLayout(outputLayout);
@@ -102,7 +102,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
m_summaryWidget->setPalette(pal);
m_summaryWidget->setAutoFillBackground(true);
QHBoxLayout *layout = new QHBoxLayout;
layout->setMargin(6);
layout->setContentsMargins(6, 6, 6, 6);
m_summaryWidget->setLayout(layout);
m_summaryLabel = new QLabel;
m_summaryLabel->setPalette(pal);
@@ -368,7 +368,6 @@ public:
auto l = new QHBoxLayout;
auto w = new QWidget;
l->setMargin(0);
l->setContentsMargins(0, 0, 5, 0);
l->addStretch(1);
l->addWidget(m_addressEdit);
@@ -637,7 +637,6 @@ ClangEditorDocumentProcessor::creatorForHeaderErrorDiagnosticWidget(
return [firstHeaderErrorDiagnostic]() {
auto vbox = new QVBoxLayout;
vbox->setMargin(0);
vbox->setContentsMargins(10, 0, 0, 2);
vbox->setSpacing(2);
@@ -95,10 +95,10 @@ PreprocessorMacroWidget::PreprocessorMacroWidget(QWidget *parent) : QWidget(pare
details->setVisible(false);
auto vbox2 = new QVBoxLayout(details);
vbox2->setMargin(0);
vbox2->setContentsMargins(0, 0, 0, 0);
auto horizontalLayout = new QHBoxLayout;
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
auto tree = new Utils::TreeView(this);
connect(tree, &QAbstractItemView::activated, tree, [tree](const QModelIndex &idx) {
tree->edit(idx);
@@ -91,7 +91,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
setDisplayName(tr("CMake"));
auto vbox = new QVBoxLayout(this);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
auto container = new Utils::DetailsWidget;
container->setState(Utils::DetailsWidget::NoSummary);
vbox->addWidget(container);
@@ -100,7 +100,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
container->setWidget(details);
auto mainLayout = new QGridLayout(details);
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setColumnStretch(1, 10);
auto project = static_cast<CMakeProject *>(bc->project());
@@ -411,7 +411,7 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep
setDisplayName(tr("Build", "CMakeProjectManager::CMakeBuildStepConfigWidget display name."));
auto fl = new QFormLayout(this);
fl->setMargin(0);
fl->setContentsMargins(0, 0, 0, 0);
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
setLayout(fl);
@@ -424,7 +424,7 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep
auto frame = new QFrame(this);
frame->setFrameStyle(QFrame::StyledPanel);
auto frameLayout = new QVBoxLayout(frame);
frameLayout->setMargin(0);
frameLayout->setContentsMargins(0, 0, 0, 0);
frameLayout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_buildTargetsList,
Core::ItemViewFind::LightColored));
@@ -550,7 +550,7 @@ void SettingsDialog::createGui()
headerHLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
headerHLayout->addWidget(m_headerLabel);
m_stackedLayout->setMargin(0);
m_stackedLayout->setContentsMargins(0, 0, 0, 0);
QWidget *emptyWidget = new QWidget(this);
m_stackedLayout->addWidget(emptyWidget); // no category selected, for example when filtering
+1 -1
View File
@@ -55,7 +55,7 @@ EditMode::EditMode() :
setId(Constants::MODE_EDIT);
m_rightSplitWidgetLayout->setSpacing(0);
m_rightSplitWidgetLayout->setMargin(0);
m_rightSplitWidgetLayout->setContentsMargins(0, 0, 0, 0);
QWidget *rightSplitWidget = new QWidget;
rightSplitWidget->setLayout(m_rightSplitWidgetLayout);
auto editorPlaceHolder = new EditorManagerPlaceHolder;
@@ -137,7 +137,7 @@ EditorManagerPlaceHolder::EditorManagerPlaceHolder(QWidget *parent)
: QWidget(parent)
{
setLayout(new QVBoxLayout);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
setFocusProxy(EditorManagerPrivate::mainEditorArea());
}
@@ -72,7 +72,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) :
{
auto tl = new QVBoxLayout(this);
tl->setSpacing(0);
tl->setMargin(0);
tl->setContentsMargins(0, 0, 0, 0);
{
connect(m_toolBar, &EditorToolBar::goBackClicked,
this, &EditorView::goBackInNavigationHistory);
@@ -50,7 +50,7 @@ EditorWindow::EditorWindow(QWidget *parent) :
{
m_area = new EditorArea;
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
setLayout(layout);
layout->addWidget(m_area);
@@ -73,7 +73,7 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) :
m_editorList->setFrameStyle(QFrame::NoFrame);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_editorList);
connect(m_editorList, &QTreeWidget::itemClicked,
+2 -2
View File
@@ -119,7 +119,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
Utils::StyledBar(parent), d(new EditorToolBarPrivate(parent, this))
{
auto toolBarLayout = new QHBoxLayout(this);
toolBarLayout->setMargin(0);
toolBarLayout->setContentsMargins(0, 0, 0, 0);
toolBarLayout->setSpacing(0);
toolBarLayout->addWidget(d->m_defaultToolBar);
d->m_toolBarPlaceholder->setLayout(toolBarLayout);
@@ -172,7 +172,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
auto toplayout = new QHBoxLayout(this);
toplayout->setSpacing(0);
toplayout->setMargin(0);
toplayout->setContentsMargins(0, 0, 0, 0);
toplayout->addWidget(d->m_backButton);
toplayout->addWidget(d->m_forwardButton);
toplayout->addWidget(d->m_lockButton);
+1 -1
View File
@@ -359,7 +359,7 @@ FancyActionBar::FancyActionBar(QWidget *parent)
{
setObjectName("actionbar");
m_actionsLayout = new QVBoxLayout;
m_actionsLayout->setMargin(0);
m_actionsLayout->setContentsMargins(0, 0, 0, 0);
m_actionsLayout->setSpacing(0);
setLayout(m_actionsLayout);
setContentsMargins(0, 2, 0, 8);
+5 -5
View File
@@ -479,11 +479,11 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
m_selectionWidget = new QWidget(this);
auto selectionLayout = new QVBoxLayout;
selectionLayout->setSpacing(0);
selectionLayout->setMargin(0);
selectionLayout->setContentsMargins(0, 0, 0, 0);
auto bar = new StyledBar;
auto layout = new QHBoxLayout(bar);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto fancyButton = new FancyColorButton(this);
connect(fancyButton, &FancyColorButton::clicked, this, &FancyTabWidget::topAreaClicked);
@@ -501,7 +501,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
auto cornerWidgetLayout = new QVBoxLayout;
cornerWidgetLayout->setSpacing(0);
cornerWidgetLayout->setMargin(0);
cornerWidgetLayout->setContentsMargins(0, 0, 0, 0);
cornerWidgetLayout->addStretch();
m_cornerWidgetContainer->setLayout(cornerWidgetLayout);
@@ -512,7 +512,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
m_statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
auto vlayout = new QVBoxLayout;
vlayout->setMargin(0);
vlayout->setContentsMargins(0, 0, 0, 0);
vlayout->setSpacing(0);
vlayout->addLayout(m_modesStack);
vlayout->addWidget(m_statusBar);
@@ -521,7 +521,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
m_infoBarDisplay.setStyle(QFrame::Sunken);
auto mainLayout = new QHBoxLayout;
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setSpacing(1);
mainLayout->addWidget(m_selectionWidget);
mainLayout->addLayout(vlayout);
@@ -93,7 +93,7 @@ FindToolWindow::FindToolWindow(QWidget *parent)
this, &FindToolWindow::updateButtonStates);
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
m_ui.configWidget->setLayout(layout);
updateButtonStates();
+1 -1
View File
@@ -139,7 +139,7 @@ static QFrame *createHelper(QAbstractItemView *treeView,
placeHolder->setLightColored(colorOption);
auto vbox = new QVBoxLayout(widget);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setSpacing(0);
vbox->addWidget(treeView);
vbox->addWidget(placeHolder);
@@ -82,7 +82,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
QWidget(parent)
{
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
setLayout(layout);
@@ -104,13 +104,13 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
auto topFindWidget = new QWidget(topWidget);
auto topFindLayout = new QHBoxLayout(topFindWidget);
topFindLayout->setMargin(0);
topFindLayout->setContentsMargins(0, 0, 0, 0);
topFindWidget->setLayout(topFindLayout);
topLayout->addWidget(topFindWidget);
m_topReplaceWidget = new QWidget(topWidget);
auto topReplaceLayout = new QHBoxLayout(m_topReplaceWidget);
topReplaceLayout->setMargin(0);
topReplaceLayout->setContentsMargins(0, 0, 0, 0);
m_topReplaceWidget->setLayout(topReplaceLayout);
topLayout->addWidget(m_topReplaceWidget);
@@ -123,7 +123,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
}
m_messageWidget->setAutoFillBackground(true);
auto messageLayout = new QHBoxLayout(m_messageWidget);
messageLayout->setMargin(2);
messageLayout->setContentsMargins(2, 2, 2, 2);
m_messageWidget->setLayout(messageLayout);
QLabel *messageLabel = new QLabel(tr("Search was canceled."));
messageLabel->setPalette(pal);
@@ -146,7 +146,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
m_descriptionContainer = new QWidget(topFindWidget);
auto descriptionLayout = new QHBoxLayout(m_descriptionContainer);
m_descriptionContainer->setLayout(descriptionLayout);
descriptionLayout->setMargin(0);
descriptionLayout->setContentsMargins(0, 0, 0, 0);
m_descriptionContainer->setMinimumWidth(200);
m_descriptionContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
m_label = new QLabel(m_descriptionContainer);
+1 -1
View File
@@ -40,7 +40,7 @@ FindToolBarPlaceHolder::FindToolBarPlaceHolder(QWidget *owner, QWidget *parent)
g_findToolBarPlaceHolders.append(this);
setLayout(new QVBoxLayout);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
}
FindToolBarPlaceHolder::~FindToolBarPlaceHolder()
+2 -2
View File
@@ -251,10 +251,10 @@ void InfoBarDisplay::update()
infoWidget->setAutoFillBackground(true);
auto hbox = new QHBoxLayout;
hbox->setMargin(2);
hbox->setContentsMargins(2, 2, 2, 2);
auto vbox = new QVBoxLayout(infoWidget);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->addLayout(hbox);
QLabel *infoWidgetLabel = new QLabel(info.m_infoText);
@@ -558,7 +558,7 @@ LocatorWidget::LocatorWidget(Locator *locator) :
auto layout = new QHBoxLayout(this);
setLayout(layout);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_fileLineEdit);
const QIcon icon = Utils::Icons::MAGNIFIER.icon();
@@ -65,7 +65,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
m_toolBar = new Utils::StyledBar(this);
auto toolBarLayout = new QHBoxLayout;
toolBarLayout->setMargin(0);
toolBarLayout->setContentsMargins(0, 0, 0, 0);
toolBarLayout->setSpacing(0);
m_toolBar->setLayout(toolBarLayout);
toolBarLayout->addWidget(m_navigationComboBox);
@@ -87,7 +87,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
toolBarLayout->addWidget(m_closeButton);
auto lay = new QVBoxLayout();
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
setLayout(lay);
lay->addWidget(m_toolBar);
+1 -1
View File
@@ -70,7 +70,7 @@ NavigationWidgetPlaceHolder::NavigationWidgetPlaceHolder(Id mode, Side side, QWi
:QWidget(parent), m_mode(mode), m_side(side)
{
setLayout(new QVBoxLayout);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
connect(ModeManager::instance(), &ModeManager::currentModeAboutToChange,
this, &NavigationWidgetPlaceHolder::currentModeAboutToChange);
}
+1 -1
View File
@@ -63,7 +63,7 @@ OutputPanePlaceHolder::OutputPanePlaceHolder(Id mode, QSplitter *parent)
sp.setVerticalPolicy(QSizePolicy::Preferred);
sp.setHorizontalStretch(0);
setSizePolicy(sp);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
this, &OutputPanePlaceHolder::currentModeChanged);
// if this is part of a lazily created mode widget,
+3 -3
View File
@@ -346,10 +346,10 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
auto mainlayout = new QVBoxLayout;
mainlayout->setSpacing(0);
mainlayout->setMargin(0);
mainlayout->setContentsMargins(0, 0, 0, 0);
m_toolBar = new StyledBar;
auto toolLayout = new QHBoxLayout(m_toolBar);
toolLayout->setMargin(0);
toolLayout->setContentsMargins(0, 0, 0, 0);
toolLayout->setSpacing(0);
toolLayout->addWidget(m_titleLabel);
toolLayout->addWidget(new StyledSeparator);
@@ -451,7 +451,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
QWidget *toolButtonsContainer = new QWidget(m_opToolBarWidgets);
auto toolButtonsLayout = new QHBoxLayout;
toolButtonsLayout->setMargin(0);
toolButtonsLayout->setContentsMargins(0, 0, 0, 0);
toolButtonsLayout->setSpacing(0);
foreach (QWidget *toolButton, outPane->toolBarWidgets())
toolButtonsLayout->addWidget(toolButton);
@@ -128,7 +128,7 @@ FutureProgress::FutureProgress(QWidget *parent) :
auto layout = new QVBoxLayout;
setLayout(layout);
layout->addWidget(d->m_progress);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addLayout(d->m_widgetLayout);
d->m_widgetLayout->setContentsMargins(7, 0, 7, 2);
+2 -2
View File
@@ -49,7 +49,7 @@ RightPanePlaceHolder::RightPanePlaceHolder(Id mode, QWidget *parent)
:QWidget(parent), m_mode(mode)
{
setLayout(new QVBoxLayout);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
this, &RightPanePlaceHolder::currentModeChanged);
}
@@ -124,7 +124,7 @@ RightPaneWidget::RightPaneWidget()
m_instance = this;
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
}
+1 -1
View File
@@ -81,7 +81,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
m_toolbar->addAction(m_closeAction);
auto lay = new QVBoxLayout();
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
setLayout(lay);
lay->addWidget(m_toolbar);
+1 -1
View File
@@ -63,7 +63,7 @@ static QWidget *createWidget(QWidget *parent)
QWidget *w = new QWidget(parent);
w->setLayout(new QHBoxLayout);
w->setVisible(true);
w->layout()->setMargin(0);
w->layout()->setContentsMargins(0, 0, 0, 0);
return w;
}
+1 -1
View File
@@ -141,7 +141,7 @@ ThemeChooserPrivate::ThemeChooserPrivate(QWidget *widget)
overriddenLabel->setText(ThemeChooser::tr("Current theme: %1")
.arg(creatorTheme()->displayName()));
layout->addWidget(overriddenLabel);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
layout->addSpacerItem(horizontalSpacer);
m_themeComboBox->setModel(m_themeListModel);
@@ -41,9 +41,8 @@ ColumnIndicatorTextEdit::ColumnIndicatorTextEdit(QWidget *parent) :
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setVerticalStretch(3);
setSizePolicy(sizePolicy);
int cmx = 0, cmy = 0, cmw = 0, cmh = 0;
getContentsMargins(&cmx, &cmy, &cmw, &cmh);
m_columnIndicator = QFontMetrics(font).horizontalAdvance(QLatin1Char('W')) * 100 + cmx + 1;
m_columnIndicator = QFontMetrics(font).horizontalAdvance(QLatin1Char('W')) * 100
+ contentsMargins().left() + 1;
m_columnIndicatorFont.setFamily(QLatin1String("Times"));
m_columnIndicatorFont.setPointSizeF(7.0);
}
@@ -409,7 +409,7 @@ CppIncludeHierarchyWidget::CppIncludeHierarchyWidget()
this, &CppIncludeHierarchyWidget::syncFromEditorManager);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_inspectedFile);
layout->addWidget(ItemViewFind::createSearchableWrapper(new IncludeFinder(m_treeView, &m_model)));
@@ -1011,7 +1011,7 @@ void InsertVirtualMethodsDialog::initGui()
auto overrideWidgetsLayout = new QHBoxLayout(this);
overrideWidgetsLayout->setSpacing(0);
overrideWidgetsLayout->setMargin(0);
overrideWidgetsLayout->setContentsMargins(0, 0, 0, 0);
overrideWidgetsLayout->addWidget(m_overrideReplacementCheckBox);
overrideWidgetsLayout->addWidget(m_overrideReplacementComboBox);
overrideWidgetsLayout->addWidget(m_clearUserAddedReplacementsButton);
+1 -1
View File
@@ -108,7 +108,7 @@ CppOutlineWidget::CppOutlineWidget(CppEditorWidget *editor) :
m_proxyModel->setSourceModel(model);
auto *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_treeView));
setLayout(layout);
+1 -1
View File
@@ -114,7 +114,7 @@ CppTypeHierarchyWidget::CppTypeHierarchyWidget()
m_hierarchyWidget = new QWidget(this);
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_inspectedClass);
layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_treeView));
@@ -45,7 +45,7 @@ ClangDiagnosticConfigsSelectionWidget::ClangDiagnosticConfigsSelectionWidget(QWi
, m_selectionComboBox(new QComboBox(this))
{
auto *layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
layout->addWidget(m_label);
layout->addWidget(m_selectionComboBox, 1);
@@ -108,7 +108,7 @@ void ClangDiagnosticConfigsSelectionWidget::connectToClangDiagnosticConfigsDialo
{
connect(button, &QPushButton::clicked, [this]() {
ClangDiagnosticConfigsWidget *widget = new ClangDiagnosticConfigsWidget(currentConfigId());
widget->layout()->setMargin(0);
widget->layout()->setContentsMargins(0, 0, 0, 0);
QDialog dialog;
dialog.setWindowTitle(ClangDiagnosticConfigsWidget::tr("Diagnostic Configurations"));
dialog.setLayout(new QVBoxLayout);
@@ -106,7 +106,7 @@ QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::ICodeStylePref
if (!cppPreferences)
return nullptr;
auto widget = new Internal::CppCodeStylePreferencesWidget(parent);
widget->layout()->setMargin(0);
widget->layout()->setContentsMargins(0, 0, 0, 0);
widget->setCodeStyle(cppPreferences);
return widget;
}
+1 -1
View File
@@ -263,7 +263,7 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *
auto layout = new QGridLayout(this);
setLayout(layout);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto typeLabel = new QLabel(tr("Types:"));
layout->addWidget(typeLabel, 0, 0);
+4 -3
View File
@@ -78,7 +78,7 @@ CdbBreakEventWidget::CdbBreakEventWidget(QWidget *parent) : QWidget(parent)
// 1 column with checkboxes only,
// further columns with checkbox + parameter
auto mainLayout = new QHBoxLayout;
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
auto leftLayout = new QVBoxLayout;
QFormLayout *parameterLayout = nullptr;
mainLayout->addLayout(leftLayout);
@@ -163,8 +163,9 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent)
// accommodate all options. This page only shows on
// Windows, which has large margins by default.
const int margin = layout()->margin();
const QMargins margins(margin, margin / 3, margin, margin / 3);
int left, top, right, bottom;
layout()->getContentsMargins(&left, &top, &right, &bottom);
const QMargins margins(left, top / 3, right, bottom / 3);
m_ui.startupFormLayout->setContentsMargins(margins);
+1 -1
View File
@@ -64,7 +64,7 @@ Console::Console()
m_consoleWidget->setEnabled(true);
auto vbox = new QVBoxLayout(m_consoleWidget);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->setSpacing(0);
m_consoleView = new ConsoleView(m_consoleItemModel, m_consoleWidget);
+4 -4
View File
@@ -202,18 +202,18 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
// "Engine switcher" style comboboxes
auto subPerspectiveSwitcher = new QWidget;
m_subPerspectiveSwitcherLayout = new QHBoxLayout(subPerspectiveSwitcher);
m_subPerspectiveSwitcherLayout->setMargin(0);
m_subPerspectiveSwitcherLayout->setContentsMargins(0, 0, 0, 0);
m_subPerspectiveSwitcherLayout->setSpacing(0);
// All perspective toolbars will get inserted here, but only
// the current perspective's toolbar is set visible.
auto innerTools = new QWidget;
m_innerToolsLayout = new QHBoxLayout(innerTools);
m_innerToolsLayout->setMargin(0);
m_innerToolsLayout->setContentsMargins(0, 0, 0, 0);
m_innerToolsLayout->setSpacing(0);
auto hbox = new QHBoxLayout(toolbar);
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(0);
hbox->addWidget(m_perspectiveChooser);
hbox->addWidget(subPerspectiveSwitcher);
@@ -727,7 +727,7 @@ Perspective::Perspective(const QString &id, const QString &name,
theMainWindow->d->m_innerToolsLayout->addWidget(d->m_innerToolBar);
d->m_innerToolBarLayout = new QHBoxLayout(d->m_innerToolBar);
d->m_innerToolBarLayout->setMargin(0);
d->m_innerToolBarLayout->setContentsMargins(0, 0, 0, 0);
d->m_innerToolBarLayout->setSpacing(0);
}
+2 -2
View File
@@ -482,7 +482,7 @@ public:
DebuggerMainWindow *mainWindow = DebuggerMainWindow::instance();
auto editorHolderLayout = new QVBoxLayout;
editorHolderLayout->setMargin(0);
editorHolderLayout->setContentsMargins(0, 0, 0, 0);
editorHolderLayout->setSpacing(0);
auto editorAndFindWidget = new QWidget;
@@ -499,7 +499,7 @@ public:
auto centralEditorWidget = new QWidget;
auto centralLayout = new QVBoxLayout(centralEditorWidget);
centralEditorWidget->setLayout(centralLayout);
centralLayout->setMargin(0);
centralLayout->setContentsMargins(0, 0, 0, 0);
centralLayout->setSpacing(0);
centralLayout->addWidget(documentAndRightPane);
centralLayout->setStretch(0, 1);
@@ -127,7 +127,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
this, &DebuggerRunConfigWidget::useMultiProcessToggled);
auto qmlLayout = new QHBoxLayout;
qmlLayout->setMargin(0);
qmlLayout->setContentsMargins(0, 0, 0, 0);
qmlLayout->addWidget(m_useQmlDebugger);
qmlLayout->addWidget(m_debugServerPortLabel);
qmlLayout->addWidget(m_debugServerPort);
@@ -135,7 +135,7 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect
qmlLayout->addStretch();
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_useCppDebugger);
layout->addLayout(qmlLayout);
layout->addWidget(m_useMultiProcess);
@@ -39,7 +39,7 @@ LocalsAndInspectorWindow::LocalsAndInspectorWindow(QWidget *locals,
QWidget *inspector, QWidget *returnWidget)
{
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto splitter = new Core::MiniSplitter(Qt::Vertical);
+4 -4
View File
@@ -423,13 +423,13 @@ LogWindow::LogWindow(DebuggerEngine *engine)
commandBox->addWidget(repeatButton);
commandBox->addWidget(new QLabel(tr("Command:"), this));
commandBox->addWidget(m_commandEdit);
commandBox->setMargin(2);
commandBox->setContentsMargins(2, 2, 2, 2);
commandBox->setSpacing(6);
auto leftBox = new QVBoxLayout;
leftBox->addWidget(m_inputText);
leftBox->addItem(commandBox);
leftBox->setMargin(0);
leftBox->setContentsMargins(0, 0, 0, 0);
leftBox->setSpacing(0);
auto leftDummy = new QWidget;
@@ -441,7 +441,7 @@ LogWindow::LogWindow(DebuggerEngine *engine)
m_splitter->setStretchFactor(1, 3);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_splitter);
layout->addWidget(new Core::FindToolBarPlaceHolder(this));
@@ -678,7 +678,7 @@ GlobalLogWindow::GlobalLogWindow()
m_splitter->setStretchFactor(1, 3);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_splitter);
layout->addWidget(new Core::FindToolBarPlaceHolder(this));
+1 -1
View File
@@ -410,7 +410,7 @@ void FormEditorData::fullInit()
m_modeWidget = new QWidget;
m_modeWidget->setObjectName("DesignerModeWidget");
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_toolBar);
// Avoid mode switch to 'Edit' mode when the application started by
@@ -727,7 +727,7 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent)
m_splitter->addWidget(m_leftEditor);
m_splitter->addWidget(m_rightEditor);
QVBoxLayout *l = new QVBoxLayout(this);
l->setMargin(0);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(m_splitter);
setFocusProxy(m_leftEditor);
@@ -51,7 +51,7 @@ GerritRemoteChooser::GerritRemoteChooser(QWidget *parent) :
m_remoteComboBox->setMinimumSize(QSize(40, 0));
horizontalLayout->addWidget(m_remoteComboBox);
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
m_resetRemoteButton = new QToolButton(this);
m_resetRemoteButton->setToolTip(tr("Refresh Remote Servers"));
+1 -1
View File
@@ -240,7 +240,7 @@ GitGrep::GitGrep(QObject *parent)
{
m_widget = new QWidget;
auto layout = new QHBoxLayout(m_widget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
m_treeLineEdit = new FancyLineEdit;
m_treeLineEdit->setPlaceholderText(tr("Tree (optional)"));
m_treeLineEdit->setToolTip(tr("Can be HEAD, tag, local or remote branch, or a commit hash.\n"
+4 -4
View File
@@ -84,12 +84,12 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
m_viewerStack = new QStackedWidget;
auto topLayout = new QVBoxLayout;
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setSpacing(0);
setLayout(topLayout);
auto hLayout = new QHBoxLayout;
hLayout->setMargin(0);
hLayout->setContentsMargins(0, 0, 0, 0);
hLayout->setSpacing(0);
topLayout->addLayout(hLayout, 10);
@@ -100,12 +100,12 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
auto toolBar = new Utils::StyledBar();
auto layout = new QHBoxLayout(toolBar);
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto rightSide = new QWidget(this);
m_sideBarSplitter->insertWidget(1, rightSide);
auto vLayout = new QVBoxLayout(rightSide);
vLayout->setMargin(0);
vLayout->setContentsMargins(0, 0, 0, 0);
vLayout->setSpacing(0);
vLayout->addWidget(toolBar);
vLayout->addWidget(m_viewerStack);
+1 -1
View File
@@ -59,7 +59,7 @@ OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model)
m_openPagesWidget->installEventFilter(this);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_openPagesWidget);
connect(m_openPagesWidget, &OpenPagesWidget::closePage,
+3 -3
View File
@@ -99,7 +99,7 @@ void SearchWidget::showEvent(QShowEvent *event)
{
if (!event->spontaneous() && !searchEngine) {
auto vLayout = new QVBoxLayout(this);
vLayout->setMargin(0);
vLayout->setContentsMargins(0, 0, 0, 0);
vLayout->setSpacing(0);
searchEngine = new QHelpSearchEngine(&LocalHelpManager::helpEngine(), this);
@@ -109,7 +109,7 @@ void SearchWidget::showEvent(QShowEvent *event)
m_queryWidget = searchEngine->queryWidget();
QLayout *tbLayout = new QVBoxLayout();
tbLayout->setSpacing(6);
tbLayout->setMargin(4);
tbLayout->setContentsMargins(4, 4, 4, 4);
tbLayout->addWidget(m_queryWidget);
m_indexingDocumentationLabel = new QLabel(tr("Indexing Documentation"), toolbar);
m_indexingDocumentationLabel->hide();
@@ -120,7 +120,7 @@ void SearchWidget::showEvent(QShowEvent *event)
toolbar2->setSingleRow(false);
tbLayout = new QVBoxLayout();
tbLayout->setSpacing(0);
tbLayout->setMargin(0);
tbLayout->setContentsMargins(0, 0, 0, 0);
tbLayout->addWidget(resultWidget = searchEngine->resultWidget());
toolbar2->setLayout(tbLayout);
+1 -1
View File
@@ -184,7 +184,7 @@ IosBuildSettingsWidget::IosBuildSettingsWidget(IosBuildConfiguration *bc)
adjustSize();
auto rootLayout = new QVBoxLayout(this);
rootLayout->setMargin(0);
rootLayout->setContentsMargins(0, 0, 0, 0);
rootLayout->addWidget(detailsWidget);
auto gridLayout = new QGridLayout();
@@ -148,7 +148,7 @@ LanguageClientOutlineWidget::LanguageClientOutlineWidget(Client *client,
client->documentSymbolCache()->requestSymbols(m_uri);
auto *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(Core::ItemViewFind::createSearchableWrapper(&m_view));
setLayout(layout);
@@ -63,7 +63,7 @@ QWidget *NimCodeStylePreferencesFactory::createEditor(TextEditor::ICodeStylePref
QWidget *parent) const
{
auto result = new NimCodeStylePreferencesWidget(preferences, parent);
result->layout()->setMargin(0);
result->layout()->setContentsMargins(0, 0, 0, 0);
return result;
}
+1 -1
View File
@@ -78,7 +78,7 @@ AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent),
d(std::make_unique<Internal::AbiWidgetPrivate>())
{
auto *layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(2);
d->m_abi = new QComboBox(this);
@@ -128,7 +128,7 @@ QWidget *AllProjectsFind::createConfigWidget()
if (!m_configWidget) {
m_configWidget = new QWidget;
auto gridLayout = new QGridLayout(m_configWidget);
gridLayout->setMargin(0);
gridLayout->setContentsMargins(0, 0, 0, 0);
m_configWidget->setLayout(gridLayout);
const QList<QPair<QWidget *, QWidget *>> patternWidgets = createPatternWidgets();
int row = 0;
@@ -230,7 +230,7 @@ AppOutputPane::AppOutputPane() :
// Spacer (?)
auto *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
m_tabWidget->setDocumentMode(true);
m_tabWidget->setTabsClosable(true);
m_tabWidget->setMovable(true);
@@ -151,14 +151,14 @@ NamedWidget *BuildConfiguration::createConfigWidget()
container->setWidget(widget);
auto vbox = new QVBoxLayout(named);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->addWidget(container);
} else {
widget = named;
}
auto formLayout = new QFormLayout(widget);
formLayout->setMargin(0);
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
for (ProjectConfigurationAspect *aspect : aspects()) {
@@ -39,7 +39,7 @@ BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc) :
m_buildConfiguration(nullptr)
{
auto vbox = new QVBoxLayout(this);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
m_clearSystemEnvironmentCheckBox->setText(tr("Clear system environment"));
+1 -1
View File
@@ -150,7 +150,7 @@ BuildStepConfigWidget *BuildStep::createConfigWidget()
auto widget = new BuildStepConfigWidget(this);
auto formLayout = new QFormLayout(widget);
formLayout->setMargin(0);
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
for (ProjectConfigurationAspect *aspect : m_aspects) {
@@ -53,7 +53,7 @@ using namespace Utils;
ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent)
{
auto layout = new QHBoxLayout;
layout->setMargin(4);
layout->setContentsMargins(4, 4, 4, 4);
layout->setSpacing(4);
setLayout(layout);
m_firstWidget = new FadingWidget(this);
@@ -75,7 +75,7 @@ ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent)
m_secondWidget = new FadingWidget(this);
m_secondWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
hbox = new QHBoxLayout();
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(4);
m_secondWidget->setLayout(hbox);
@@ -101,7 +101,7 @@ CustomExecutableDialog::CustomExecutableDialog(RunConfiguration *rc)
auto layout = new QFormLayout;
layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto detailsContainer = new DetailsWidget(this);
detailsContainer->setState(DetailsWidget::NoSummary);
@@ -49,11 +49,11 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
setContentsMargins(0, 0, 0, 0);
auto topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
auto baseEnvironmentWidget = new QWidget;
auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
baseLayout->setMargin(0);
baseLayout->setContentsMargins(0, 0, 0, 0);
auto label = new QLabel(tr("Base environment for this run configuration:"), this);
baseLayout->addWidget(label);
@@ -123,13 +123,13 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, Type type, QWidget *additi
details->setVisible(false);
auto vbox2 = new QVBoxLayout(details);
vbox2->setMargin(0);
vbox2->setContentsMargins(0, 0, 0, 0);
if (additionalDetailsWidget)
vbox2->addWidget(additionalDetailsWidget);
auto horizontalLayout = new QHBoxLayout();
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
auto tree = new Utils::TreeView(this);
connect(tree, &QAbstractItemView::activated,
tree, [tree](const QModelIndex &idx) { tree->edit(idx); });
@@ -95,7 +95,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
inner->setLayout(m_layout);
auto mainLayout = new QGridLayout(this);
mainLayout->setMargin(1);
mainLayout->setContentsMargins(1, 1, 1, 1);
mainLayout->addWidget(inner, 0, 0);
label = createLabel(tr("Name:"), tr("Kit name and icon."));
@@ -612,7 +612,7 @@ QListWidgetItem *GenericListWidget::itemForProjectConfiguration(QObject *pc)
KitAreaWidget::KitAreaWidget(QWidget *parent) : QWidget(parent),
m_layout(new QGridLayout(this))
{
m_layout->setMargin(3);
m_layout->setContentsMargins(3, 3, 3, 3);
setAutoFillBackground(true);
connect(KitManager::instance(), &KitManager::kitUpdated, this, &KitAreaWidget::updateKit);
}
+1 -1
View File
@@ -128,7 +128,7 @@ PanelsWidget::PanelsWidget(QWidget *parent) :
// The layout holding the individual panels:
auto topLayout = new QVBoxLayout(m_root);
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->setSpacing(0);
m_layout = new QGridLayout;
@@ -252,7 +252,7 @@ QWidget *RunConfiguration::createConfigurationWidget()
{
auto widget = new QWidget;
auto formLayout = new QFormLayout(widget);
formLayout->setMargin(0);
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
for (ProjectConfigurationAspect *aspect : m_aspects) {
@@ -121,7 +121,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
// deploy part
deployWidget->setContentsMargins(0, 10, 0, 25);
m_deployLayout = new QVBoxLayout(deployWidget);
m_deployLayout->setMargin(0);
m_deployLayout->setContentsMargins(0, 0, 0, 0);
m_deployLayout->setSpacing(5);
m_deployConfigurationCombo->setModel(m_target->deployConfigurationModel());
@@ -153,7 +153,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
// run part
runWidget->setContentsMargins(0, 10, 0, 25);
m_runLayout = new QVBoxLayout(runWidget);
m_runLayout->setMargin(0);
m_runLayout->setContentsMargins(0, 0, 0, 0);
m_runLayout->setSpacing(5);
m_disabledIcon = new QLabel;
@@ -550,7 +550,7 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) :
QLatin1String(HIDE_FILE_FILTER_DEFAULT)).toString();
auto layout = new QGridLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
m_baseDirLabel->setText(tr("Source directory:"));
m_baseDirChooser->setHistoryCompleter(QLatin1String("PE.AddToProjectDir.History"));
@@ -151,7 +151,7 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project)
hbox->addWidget(box);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
m_setupPageContainer = new QVBoxLayout;
layout->addLayout(m_setupPageContainer);
layout->addLayout(hbox);
@@ -268,7 +268,7 @@ void TargetGroupItemPrivate::ensureWidget()
label->setAlignment(Qt::AlignTop);
auto layout = new QVBoxLayout(m_noKitLabel);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(label);
layout->addStretch(10);
@@ -287,7 +287,7 @@ void TargetGroupItemPrivate::ensureWidget()
auto widget = new QWidget;
auto label = new QLabel("This project is already configured.");
auto layout = new QVBoxLayout(widget);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(label);
layout->addStretch(10);
m_configuredPage = new PanelsWidget(tr("Configure Project"),
@@ -195,7 +195,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
m_ui->scrollArea->setWidget(centralWidget);
centralWidget->setLayout(new QVBoxLayout);
m_ui->centralWidget->setLayout(new QVBoxLayout);
m_ui->centralWidget->layout()->setMargin(0);
m_ui->centralWidget->layout()->setContentsMargins(0, 0, 0, 0);
setTitle(tr("Kit Selection"));
@@ -84,7 +84,7 @@ TargetSetupWidget::TargetSetupWidget(Kit *k, const FilePath &projectPath) :
auto w = new QWidget;
m_newBuildsLayout = new QGridLayout;
m_newBuildsLayout->setMargin(0);
m_newBuildsLayout->setContentsMargins(0, 0, 0, 0);
if (Utils::HostOsInfo::isMacHost())
m_newBuildsLayout->setSpacing(0);
w->setLayout(m_newBuildsLayout);
@@ -69,7 +69,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
auto vbox = new QVBoxLayout(this);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
vbox->addWidget(m_detailsContainer);
auto details = new QWidget(m_detailsContainer);
@@ -1070,10 +1070,10 @@ DesignerActionToolBar::DesignerActionToolBar(QWidget *parentWidget) : Utils::Sty
auto horizontalLayout = new QHBoxLayout(this);
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setSpacing(0);
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setSpacing(0);
horizontalLayout->addWidget(m_toolBar);
@@ -61,7 +61,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/formeditorstylesheet.css")))));
auto fillLayout = new QVBoxLayout(this);
fillLayout->setMargin(0);
fillLayout->setContentsMargins(0, 0, 0, 0);
fillLayout->setSpacing(0);
setLayout(fillLayout);
@@ -43,7 +43,7 @@ ToolBox::ToolBox(QWidget *parentWidget)
m_leftToolBar->setOrientation(Qt::Horizontal);
auto horizontalLayout = new QHBoxLayout(this);
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setSpacing(0);
auto stretchToolbar = new QToolBar(this);
@@ -129,7 +129,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
QWidget *lineEditFrame = new QWidget(this);
lineEditFrame->setObjectName(QStringLiteral("itemLibrarySearchInputFrame"));
auto lineEditLayout = new QGridLayout(lineEditFrame);
lineEditLayout->setMargin(2);
lineEditLayout->setContentsMargins(2, 2, 2, 2);
lineEditLayout->setSpacing(0);
lineEditLayout->addItem(new QSpacerItem(5, 3, QSizePolicy::Fixed, QSizePolicy::Fixed), 0, 0, 1, 3);
lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
@@ -167,11 +167,11 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
connect(&m_compressionTimer, &QTimer::timeout, this, &ItemLibraryWidget::updateModel);
auto flowLayout = new Utils::FlowLayout(m_importTagsWidget.data());
flowLayout->setMargin(4);
flowLayout->setContentsMargins(4, 4, 4, 4);
m_addResourcesWidget->setVisible(false);
flowLayout = new Utils::FlowLayout(m_addResourcesWidget.data());
flowLayout->setMargin(4);
flowLayout->setContentsMargins(4, 4, 4, 4);
auto button = new QToolButton(m_addResourcesWidget.data());
auto font = button->font();
font.setPixelSize(Theme::instance()->smallFontPixelSize());
@@ -59,7 +59,7 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view)
auto layout = new QVBoxLayout;
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto tabBar = new QTabBar(this);
tabBar->addTab(tr("Navigator"));
@@ -546,10 +546,10 @@ TimelineRulerSectionItem *TimelineRulerSectionItem::create(QGraphicsScene *paren
auto layout = new QHBoxLayout(widget);
layout->addWidget(toolBar);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(toolBar);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
QGraphicsProxyWidget *proxy = parentScene->addWidget(widget);
proxy->setParentItem(item);
+3 -3
View File
@@ -376,7 +376,7 @@ void DesignModeWidget::setup()
m_mainSplitter->setSizes({150, 300, 150});
QLayout *mainLayout = new QBoxLayout(QBoxLayout::RightToLeft, this);
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->setSpacing(0);
mainLayout->addWidget(m_mainSplitter);
@@ -514,7 +514,7 @@ QWidget *DesignModeWidget::createCenterWidget()
QWidget *centerWidget = new QWidget;
auto horizontalLayout = new QVBoxLayout(centerWidget);
horizontalLayout->setMargin(0);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setSpacing(0);
horizontalLayout->addWidget(m_toolBar);
@@ -537,7 +537,7 @@ QWidget *DesignModeWidget::createCrumbleBarFrame()
auto frame = new Utils::StyledBar(this);
frame->setSingleRow(false);
auto layout = new QHBoxLayout(frame);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_crumbleBar->crumblePath());
@@ -91,7 +91,7 @@ DocumentWarningWidget::DocumentWarningWidget(QWidget *parent)
auto layout = new QVBoxLayout(this);
layout->addWidget(m_headerLabel);
auto messageLayout = new QVBoxLayout;
messageLayout->setMargin(20);
messageLayout->setContentsMargins(20, 20, 20, 20);
messageLayout->setSpacing(5);
messageLayout->addWidget(m_navigateLabel);
messageLayout->addWidget(m_messageLabel);
+1 -1
View File
@@ -105,7 +105,7 @@ QmlJSOutlineWidget::QmlJSOutlineWidget(QWidget *parent)
auto layout = new QVBoxLayout;
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_treeView));
@@ -75,7 +75,7 @@ QWidget *QmlJSCodeStylePreferencesFactory::createEditor(TextEditor::ICodeStylePr
QWidget *parent) const
{
auto widget = new Internal::QmlJSCodeStylePreferencesWidget(parent);
widget->layout()->setMargin(0);
widget->layout()->setContentsMargins(0, 0, 0, 0);
widget->setPreferences(preferences);
return widget;
}
@@ -49,7 +49,6 @@ ColorPicker::ColorPicker(const QString &key, QWidget *parent)
auto vBoxLayout = new QVBoxLayout;
vBoxLayout->setContentsMargins(0, 0, 0, 0);
vBoxLayout->setMargin(0);
vBoxLayout->setSpacing(0);
const int buttonRowsCount = 4;
@@ -58,7 +57,6 @@ ColorPicker::ColorPicker(const QString &key, QWidget *parent)
for (int r = 0; r < buttonRowsCount; ++r) {
auto hBoxLayout = new QHBoxLayout;
hBoxLayout->setContentsMargins(0, 0, 0, 0);
hBoxLayout->setMargin(0);
hBoxLayout->setSpacing(0);
for (int c = 0; c < buttonColumnsCount; ++c)
@@ -672,7 +672,7 @@ void MainWidget::createUi()
m_mainContentWidget = new QWidget;
m_mainContentWidget->setLayout(new QVBoxLayout);
m_mainContentWidget->layout()->setMargin(0);
m_mainContentWidget->layout()->setContentsMargins(0, 0, 0, 0);
m_mainContentWidget->layout()->addWidget(m_stackedWidget);
m_mainContentWidget->layout()->addWidget(m_outputPaneWindow);
@@ -692,7 +692,7 @@ void MainWidget::createUi()
setLayout(new QVBoxLayout);
layout()->addWidget(m_horizontalSplitter);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
}
void MainWidget::showEvent(QShowEvent *e)
+1 -1
View File
@@ -96,7 +96,7 @@ void Navigator::createUi()
setLayout(new QVBoxLayout);
layout()->setSpacing(0);
layout()->setMargin(0);
layout()->setContentsMargins(0, 0, 0, 0);
layout()->addWidget(titleToolBar);
layout()->addWidget(m_navigatorView);
layout()->addWidget(m_navigatorSlider);

Some files were not shown because too many files have changed in this diff Show More