Replaced QLayout::setMargin with QLayout::setContentsMargins

It's been already deprecated in Qt5, removed from Qt6 completely

Reference:
- https://doc.qt.io/qt-5/qlayout-obsolete.html
This commit is contained in:
zneix 2021-07-31 19:45:17 +02:00
parent c99f12e8fe
commit fa31c57dc9
No known key found for this signature in database
GPG key ID: 911916E0523B22F6
13 changed files with 17 additions and 17 deletions

View file

@ -46,7 +46,7 @@ AttachedWindow::AttachedWindow(void *_target, int _yOffset)
, yOffset_(_yOffset)
{
QLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
this->setLayout(layout);
auto *split = new Split(this);

View file

@ -150,7 +150,7 @@ void BaseWindow::init()
{
QHBoxLayout *buttonLayout = this->ui_.titlebarBox =
new QHBoxLayout();
buttonLayout->setMargin(0);
buttonLayout->setContentsMargins(0, 0, 0, 0);
layout->addLayout(buttonLayout);
// title

View file

@ -29,7 +29,7 @@ StreamView::StreamView(ChannelPtr channel, const QUrl &url)
chat->setChannel(std::move(channel));
this->layout()->setSpacing(0);
this->layout()->setMargin(0);
this->layout()->setContentsMargins(0, 0, 0, 0);
}
} // namespace chatterino

View file

@ -149,7 +149,7 @@ void Window::addLayout()
this->getLayoutContainer()->setLayout(layout);
// set margin
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
this->notebook_->setAllowUserTabManagement(true);
this->notebook_->setShowAddButton(true);

View file

@ -139,7 +139,7 @@ EmotePopup::EmotePopup(QWidget *parent)
auto notebook = new Notebook(this);
layout->addWidget(notebook);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
auto clicked = [this](const Link &link) {
this->linkClicked.invoke(link);

View file

@ -84,7 +84,7 @@ void SettingsDialog::initUi()
.assign(&this->ui_.pageStack)
.withoutMargin();
this->ui_.pageStack->setMargin(0);
this->ui_.pageStack->setContentsMargins(0, 0, 0, 0);
outerBox->addSpacing(12);
@ -154,7 +154,7 @@ void SettingsDialog::filterElements(const QString &text)
void SettingsDialog::addTabs()
{
this->ui_.tabContainer->setMargin(0);
this->ui_.tabContainer->setContentsMargins(0, 0, 0, 0);
this->ui_.tabContainer->setSpacing(0);
this->ui_.tabContainer->setContentsMargins(0, 20, 0, 20);

View file

@ -28,7 +28,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
// create layout
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
// create button layout
QHBoxLayout *buttons = new QHBoxLayout(this);

View file

@ -13,7 +13,7 @@ EffectLabel::EffectLabel(BaseWidget *parent, int spacing)
this->label_.setAlignment(Qt::AlignCenter);
this->hbox_.setMargin(0);
this->hbox_.setContentsMargins(0, 0, 0, 0);
this->hbox_.addSpacing(spacing);
this->hbox_.addWidget(&this->label_);
this->hbox_.addSpacing(spacing);
@ -29,7 +29,7 @@ EffectLabel2::EffectLabel2(BaseWidget *parent, int padding)
// this->label_.setAlignment(Qt::AlignCenter);
this->label_.setCentered(true);
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
// hbox.addSpacing(spacing);
hbox->addWidget(&this->label_);
// hbox.addSpacing(spacing);

View file

@ -116,13 +116,13 @@ void SearchPopup::initLayout()
// VBOX
{
QVBoxLayout *layout1 = new QVBoxLayout(this);
layout1->setMargin(0);
layout1->setContentsMargins(0, 0, 0, 0);
layout1->setSpacing(0);
// HBOX
{
QHBoxLayout *layout2 = new QHBoxLayout(this);
layout2->setMargin(8);
layout2->setContentsMargins(8, 8, 8, 8);
layout2->setSpacing(8);
// SEARCH INPUT

View file

@ -90,7 +90,7 @@ Split::Split(QWidget *parent)
this->view_->setFocusPolicy(Qt::FocusPolicy::NoFocus);
this->vbox_->setSpacing(0);
this->vbox_->setMargin(1);
this->vbox_->setContentsMargins(1, 1, 1, 1);
this->vbox_->addWidget(this->header_);
this->vbox_->addWidget(this->view_, 1);

View file

@ -325,7 +325,7 @@ void SplitHeader::initializeLayout()
},
this->managedConnections_);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
this->setLayout(layout);

View file

@ -144,8 +144,8 @@ void SplitInput::themeChangedEvent()
this->ui_.textEdit->setPalette(placeholderPalette);
this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet);
this->ui_.hbox->setMargin(
int((this->theme->isLightTheme() ? 4 : 2) * this->scale()));
int scale = (this->theme->isLightTheme() ? 4 : 2) * this->scale();
this->ui_.hbox->setContentsMargins(scale, scale, scale, scale);
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
}

View file

@ -22,7 +22,7 @@ SplitOverlay::SplitOverlay(Split *parent)
{
QGridLayout *layout = new QGridLayout(this);
this->layout_ = layout;
layout->setMargin(1);
layout->setContentsMargins(1, 1, 1, 1);
layout->setSpacing(1);
layout->setRowStretch(1, 1);