浏览代码

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
https://github.com/qt/qtbase/commit/d6d33f0b80dd85043c71f71a3ed5485d6014e6c4
https://github.com/qt/qtbase/blame/5.15.2/src/widgets/kernel/qlayout.h
Ryan Foster 4 年之前
父节点
当前提交
54207a0d60
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      UI/hotkey-edit.hpp
  2. 1 1
      UI/window-importer.cpp
  3. 1 1
      UI/window-remux.cpp

+ 1 - 1
UI/hotkey-edit.hpp

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

+ 1 - 1
UI/window-importer.cpp

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

+ 1 - 1
UI/window-remux.cpp

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