File: 0120-qt-use-QLayout-setContentsMargins-instead-of-QLayout.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (226 lines) | stat: -rw-r--r-- 11,187 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 08:41:58 +0100
Subject: qt: use QLayout::setContentsMargins() instead of
 QLayout::setMargin()

Similar to ed986711c159499b873157d4e5d4a53026d94719.

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

[^1] https://doc.qt.io/qt-5/qlayout-obsolete.html#setMargin
[^2] https://github.com/qt/qtbase/commit/d6d33f0b80dd85043c71f71a3ed5485d6014e6c4
---
 modules/gui/qt/components/controller.cpp             | 16 ++++++++--------
 modules/gui/qt/components/controller_widget.cpp      |  2 +-
 modules/gui/qt/components/playlist/playlist.cpp      |  2 +-
 modules/gui/qt/components/playlist/standardpanel.cpp |  2 +-
 modules/gui/qt/components/playlist/views.cpp         |  2 +-
 modules/gui/qt/dialogs/external.cpp                  |  2 +-
 modules/gui/qt/dialogs/preferences.cpp               |  2 +-
 modules/gui/qt/dialogs/toolbar.cpp                   |  6 +++---
 modules/gui/qt/main_interface.cpp                    |  4 ++--
 9 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 3adfe67..0006a74 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -536,12 +536,12 @@ QFrame *AbstractController::discFrame()
     QFrame *discFrame = new QFrame( this );
 
     QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
-    discLayout->setSpacing( 0 ); discLayout->setMargin( 0 );
+    discLayout->setSpacing( 0 ); discLayout->setContentsMargins( 0, 0, 0, 0 );
 
 
     QFrame *chapFrame = new QFrame( discFrame );
     QHBoxLayout *chapLayout = new QHBoxLayout( chapFrame );
-    chapLayout->setSpacing( 0 ); chapLayout->setMargin( 0 );
+    chapLayout->setSpacing( 0 ); chapLayout->setContentsMargins( 0, 0, 0, 0 );
 
     QToolButton *prevSectionButton = new QToolButton( chapFrame );
     setupButton( prevSectionButton );
@@ -560,7 +560,7 @@ QFrame *AbstractController::discFrame()
 
     QFrame *menuFrame = new QFrame( discFrame );
     QHBoxLayout *menuLayout = new QHBoxLayout( menuFrame );
-    menuLayout->setSpacing( 0 ); menuLayout->setMargin( 0 );
+    menuLayout->setSpacing( 0 ); menuLayout->setContentsMargins( 0, 0, 0, 0 );
 
     QToolButton *menuButton = new QToolButton( menuFrame );
     setupButton( menuButton );
@@ -594,7 +594,7 @@ QFrame *AbstractController::telexFrame()
      **/
     QFrame *telexFrame = new QFrame( this );
     QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
-    telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
+    telexLayout->setSpacing( 0 ); telexLayout->setContentsMargins( 0, 0, 0, 0 );
     CONNECT( THEMIM->getIM(), teletextPossible( bool ),
              telexFrame, setVisible( bool ) );
 
@@ -720,14 +720,14 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     controlLayout->setContentsMargins( 3, 1, 0, 1 );
     controlLayout->setSpacing( 0 );
     QHBoxLayout *controlLayout1 = new QHBoxLayout;
-    controlLayout1->setSpacing( 0 ); controlLayout1->setMargin( 0 );
+    controlLayout1->setSpacing( 0 ); controlLayout1->setContentsMargins( 0, 0, 0, 0 );
 
     QString line1 = getSettings()->value( "MainWindow/MainToolbar1", MAIN_TB1_DEFAULT )
                                         .toString();
     parseAndCreate( line1, controlLayout1 );
 
     QHBoxLayout *controlLayout2 = new QHBoxLayout;
-    controlLayout2->setSpacing( 0 ); controlLayout2->setMargin( 0 );
+    controlLayout2->setSpacing( 0 ); controlLayout2->setContentsMargins( 0, 0, 0, 0 );
     QString line2 = getSettings()->value( "MainWindow/MainToolbar2", MAIN_TB2_DEFAULT )
                                         .toString();
     parseAndCreate( line2, controlLayout2 );
@@ -760,7 +760,7 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) :
 {
     RTL_UNAFFECTED_WIDGET
     controlLayout = new QHBoxLayout( this );
-    controlLayout->setMargin( 0 );
+    controlLayout->setContentsMargins( 0, 0, 0, 0 );
     controlLayout->setSpacing( 0 );
 #ifdef DEBUG_LAYOUT
     setStyleSheet( "background: orange ");
@@ -777,7 +777,7 @@ InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i, QWidget *_parent
 {
     RTL_UNAFFECTED_WIDGET
     controlLayout = new QHBoxLayout( this );
-    controlLayout->setMargin( 0 );
+    controlLayout->setContentsMargins( 0, 0, 0, 0 );
     controlLayout->setSpacing( 0 );
 #ifdef DEBUG_LAYOUT
     setStyleSheet( "background: green ");
diff --git a/modules/gui/qt/components/controller_widget.cpp b/modules/gui/qt/components/controller_widget.cpp
index 45ce421..2cbbbc8 100644
--- a/modules/gui/qt/components/controller_widget.cpp
+++ b/modules/gui/qt/components/controller_widget.cpp
@@ -49,7 +49,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
 {
     /* We need a layout for this widget */
     QHBoxLayout *layout = new QHBoxLayout( this );
-    layout->setSpacing( 0 ); layout->setMargin( 0 );
+    layout->setSpacing( 0 ); layout->setContentsMargins( 0, 0, 0, 0 );
 
     /* We need a Label for the pix */
     volMuteLabel = new QLabel;
diff --git a/modules/gui/qt/components/playlist/playlist.cpp b/modules/gui/qt/components/playlist/playlist.cpp
index d2849a2..5f6a248 100644
--- a/modules/gui/qt/components/playlist/playlist.cpp
+++ b/modules/gui/qt/components/playlist/playlist.cpp
@@ -53,7 +53,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
     setContentsMargins( 0, 3, 0, 3 );
 
     QGridLayout *layout = new QGridLayout( this );
-    layout->setMargin( 0 ); layout->setSpacing( 0 );
+    layout->setContentsMargins( 0, 0, 0, 0 ); layout->setSpacing( 0 );
 
     /*******************
      * Left            *
diff --git a/modules/gui/qt/components/playlist/standardpanel.cpp b/modules/gui/qt/components/playlist/standardpanel.cpp
index 226914f..326f4f0 100644
--- a/modules/gui/qt/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt/components/playlist/standardpanel.cpp
@@ -89,7 +89,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                   p_selector( _p_selector )
 {
     viewStack = new QStackedLayout( this );
-    viewStack->setSpacing( 0 ); viewStack->setMargin( 0 );
+    viewStack->setSpacing( 0 ); viewStack->setContentsMargins( 0, 0, 0, 0 );
     setMinimumWidth( 300 );
 
     iconView    = NULL;
diff --git a/modules/gui/qt/components/playlist/views.cpp b/modules/gui/qt/components/playlist/views.cpp
index 70dd29d..2e80e13 100644
--- a/modules/gui/qt/components/playlist/views.cpp
+++ b/modules/gui/qt/components/playlist/views.cpp
@@ -477,7 +477,7 @@ void PlTreeView::keyPressEvent( QKeyEvent *event )
 PicFlowView::PicFlowView( QAbstractItemModel *p_model, QWidget *parent ) : QAbstractItemView( parent )
 {
     QHBoxLayout *layout = new QHBoxLayout( this );
-    layout->setMargin( 0 );
+    layout->setContentsMargins( 0, 0, 0, 0 );
     picFlow = new PictureFlow( this, p_model );
     picFlow->setContextMenuPolicy( Qt::CustomContextMenu );
     connect( picFlow, SIGNAL(customContextMenuRequested( const QPoint & )),
diff --git a/modules/gui/qt/dialogs/external.cpp b/modules/gui/qt/dialogs/external.cpp
index 4c78c61..69929f7 100644
--- a/modules/gui/qt/dialogs/external.cpp
+++ b/modules/gui/qt/dialogs/external.cpp
@@ -190,7 +190,7 @@ void DialogHandler::displayLogin(vlc_dialog_id *p_id, const QString &title,
     dialog->setWindowTitle (title);
     dialog->setWindowRole ("vlc-login");
     dialog->setModal(true);
-    layout->setMargin (2);
+    layout->setContentsMargins( 2, 2, 2, 2 );
 
     /* Username and password fields */
     QWidget *panel = new QWidget (dialog);
diff --git a/modules/gui/qt/dialogs/preferences.cpp b/modules/gui/qt/dialogs/preferences.cpp
index 110c60d..e0b7692 100644
--- a/modules/gui/qt/dialogs/preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences.cpp
@@ -126,7 +126,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
     setLayout( main_layout );
 
     /* Margins */
-    simple_tree_panel->layout()->setMargin( 1 );
+    simple_tree_panel->layout()->setContentsMargins( 1, 1, 1, 1 );
     simple_panels_stack->layout()->setContentsMargins( 6, 0, 0, 3 );
 
     for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
diff --git a/modules/gui/qt/dialogs/toolbar.cpp b/modules/gui/qt/dialogs/toolbar.cpp
index 58a90f7..22e351c 100644
--- a/modules/gui/qt/dialogs/toolbar.cpp
+++ b/modules/gui/qt/dialogs/toolbar.cpp
@@ -497,7 +497,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
                 QWidget *discFrame = new QWidget( this );
                 //discFrame->setLineWidth( 1 );
                 QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
-                discLayout->setSpacing( 0 ); discLayout->setMargin( 0 );
+                discLayout->setSpacing( 0 ); discLayout->setContentsMargins( 0, 0, 0, 0 );
 
                 QToolButton *prevSectionButton = new QToolButton( discFrame );
                 prevSectionButton->setIcon( QIcon( ":/toolbar/dvd_prev.svg" ) );
@@ -522,7 +522,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
             {
                 QWidget *telexFrame = new QWidget( this );
                 QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
-                telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
+                telexLayout->setSpacing( 0 ); telexLayout->setContentsMargins( 0, 0, 0, 0 );
 
                 QToolButton *telexOn = new QToolButton( telexFrame );
                 telexOn->setIcon( QIcon( ":/toolbar/tv.svg" ) );
@@ -638,7 +638,7 @@ DroppingController::DroppingController( intf_thread_t *_p_intf,
     setAcceptDrops( true );
     controlLayout = new QHBoxLayout( this );
     controlLayout->setSpacing( 5 );
-    controlLayout->setMargin( 0 );
+    controlLayout->setContentsMargins( 0, 0, 0, 0 );
     setFrameShape( QFrame::StyledPanel );
     setFrameShadow( QFrame::Raised );
     setMinimumHeight( 20 );
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 095c765..fc33ec5 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -364,7 +364,7 @@ void MainInterface::createResumePanel( QWidget *w )
     resumePanel = new QWidget( w );
     resumePanel->hide();
     QHBoxLayout *resumePanelLayout = new QHBoxLayout( resumePanel );
-    resumePanelLayout->setSpacing( 0 ); resumePanelLayout->setMargin( 0 );
+    resumePanelLayout->setSpacing( 0 ); resumePanelLayout->setContentsMargins( 0, 0, 0, 0 );
 
     QLabel *continuePixmapLabel = new QLabel();
     continuePixmapLabel->setPixmap( ImageHelper::loadSvgToPixmap( ":/menu/help.svg" , fontMetrics().height(), fontMetrics().height()) );
@@ -458,7 +458,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
     setCentralWidget( main );
     mainLayout = new QVBoxLayout( main );
     main->setContentsMargins( 0, 0, 0, 0 );
-    mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 );
+    mainLayout->setSpacing( 0 ); mainLayout->setContentsMargins( 0, 0, 0, 0 );
 
     createResumePanel( main );
     /* */