From: Steve Lhomme Date: Tue, 17 Dec 2024 07:41:58 +0000 (+0100) Subject: qt: use QLayout::setContentsMargins() instead of QLayout::setMargin() X-Git-Tag: archive/raspbian/3.0.21-7+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=42268c397eb9e2c1c8ddb2a75548513e60d70032;p=vlc.git 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 Gbp-Pq: Name 0120-qt-use-QLayout-setContentsMargins-instead-of-QLayout.patch --- diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp index 3adfe67c..0006a742 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 45ce4219..2cbbbc84 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 d2849a25..5f6a248b 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 226914f5..326f4f0f 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 70dd29df..2e80e137 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 4c78c619..69929f70 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 110c60d1..e0b76922 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 58a90f7c..22e351cc 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 095c7659..fc33ec51 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 ); /* */