UI: Replace deprecated QLayout->setMargin with setContentsMargin

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
d6d33f0b80
https://github.com/qt/qtbase/blame/5.15.2/src/widgets/kernel/qlayout.h
master
Ryan Foster 2020-12-02 14:29:30 -05:00 committed by Jim
parent 900b5341eb
commit 54207a0d60
3 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ public:
{
auto layout = new QVBoxLayout;
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
SetKeyCombinations(combos);

View File

@ -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();

View File

@ -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();