Skip to content

Commit

Permalink
UI: Replace deprecated QLayout->setMargin with setContentsMargin
Browse files Browse the repository at this point in the history
QLayout->setMargin has been deprecated since Qt 5.13 (though marked
obsolete since at least Qt 4.8) and removed in Qt6. It was replaced by
QLayout->setContentsMargins, which is available in all versions of Qt5.
Building against Qt 5.13+ can produce compiler warnings when using
QLayout->setMargin, and warnings are bad.

https://doc.qt.io/archives/qt-4.8/qlayout-obsolete.html
https://doc.qt.io/qt-5/qlayout-obsolete.html
qt/qtbase@d6d33f0
https://github.com/qt/qtbase/blame/5.15.2/src/widgets/kernel/qlayout.h
  • Loading branch information
RytoEX authored and jp9000 committed Jan 19, 2021
1 parent 900b534 commit 54207a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UI/hotkey-edit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class OBSHotkeyWidget : public QWidget {
{
auto layout = new QVBoxLayout;
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);

SetKeyCombinations(combos);
Expand Down
2 changes: 1 addition & 1 deletion UI/window-importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ QWidget *ImporterEntryPathItemDelegate::createEditor(
};

QHBoxLayout *layout = new QHBoxLayout();
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);

QLineEdit *text = new QLineEdit();
Expand Down
2 changes: 1 addition & 1 deletion UI/window-remux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ QWidget *RemuxEntryPathItemDelegate::createEditor(
};

QHBoxLayout *layout = new QHBoxLayout();
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);

QLineEdit *text = new QLineEdit();
Expand Down

0 comments on commit 54207a0

Please sign in to comment.