diff --git a/conf/dlgdebug.cpp b/conf/dlgdebug.cpp index af1acc50f..5c17e51e3 100644 --- a/conf/dlgdebug.cpp +++ b/conf/dlgdebug.cpp @@ -23,7 +23,7 @@ DlgDebug::DlgDebug( QWidget * parent ) : QWidget( parent ) { QVBoxLayout * lay = new QVBoxLayout( this ); - lay->setMargin( 0 ); + lay->setContentsMargins( 0, 0, 0, 0 ); DEBUG_SIMPLE_BOOL( "DebugDrawBoundaries", lay ); DEBUG_SIMPLE_BOOL( "DebugDrawAnnotationRect", lay ); diff --git a/core/script/kjs_console.cpp b/core/script/kjs_console.cpp index 8412bcadc..9cd9838e6 100644 --- a/core/script/kjs_console.cpp +++ b/core/script/kjs_console.cpp @@ -42,7 +42,7 @@ static void createConsoleWindow() g_jsConsoleWindow->setButtonGuiItem( KDialog::User1, KStandardGuiItem::clear() ); QVBoxLayout *mainLay = new QVBoxLayout( g_jsConsoleWindow->mainWidget() ); - mainLay->setMargin( 0 ); + mainLay->setContentsMargins( 0, 0, 0, 0 ); g_jsConsoleLog = new QPlainTextEdit( g_jsConsoleWindow->mainWidget() ); g_jsConsoleLog->setReadOnly( true ); mainLay->addWidget( g_jsConsoleLog ); diff --git a/generators/dvi/dviRenderer.cpp b/generators/dvi/dviRenderer.cpp index bf4b5acef..3fafac6f5 100644 --- a/generators/dvi/dviRenderer.cpp +++ b/generators/dvi/dviRenderer.cpp @@ -282,7 +282,7 @@ void dviRenderer::showThatSourceInformationIsPresent() QVBoxLayout *topcontentsVBoxLayout = new QVBoxLayout(topcontents); topcontentsVBoxLayout->setContentsMargins(0, 0, 0, 0); topcontentsVBoxLayout->setSpacing(KDialog::spacingHint()*2); - topcontentsVBoxLayout->setMargin(KDialog::marginHint()*2); + topcontentsVBoxLayout->setContentsMargins(KDialog::marginHint()*2, KDialog::marginHint()*2, KDialog::marginHint()*2, KDialog::marginHint()*2); QWidget *contents = new QWidget(topcontents); topcontentsVBoxLayout->addWidget(contents); diff --git a/part.cpp b/part.cpp index 9e8fb3d97..39d798c73 100644 --- a/part.cpp +++ b/part.cpp @@ -466,14 +466,14 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo QWidget * miniBarContainer = new QWidget( 0 ); m_sidebar->setBottomWidget( miniBarContainer ); QVBoxLayout * miniBarLayout = new QVBoxLayout( miniBarContainer ); - miniBarLayout->setMargin( 0 ); + miniBarLayout->setContentsMargins( 0, 0, 0, 0 ); // widgets: [../[spacer/..]] | [] miniBarLayout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // widgets: [../[../MiniBar]] | [] QFrame * bevelContainer = new QFrame( miniBarContainer ); bevelContainer->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); QVBoxLayout * bevelContainerLayout = new QVBoxLayout( bevelContainer ); - bevelContainerLayout->setMargin( 4 ); + bevelContainerLayout->setContentsMargins( 4, 4, 4, 4 ); m_progressWidget = new ProgressWidget( bevelContainer, m_document ); bevelContainerLayout->addWidget( m_progressWidget ); miniBarLayout->addWidget( bevelContainer ); @@ -484,7 +484,7 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo QWidget * rightContainer = new QWidget( nullptr ); m_sidebar->setMainWidget( rightContainer ); QVBoxLayout * rightLayout = new QVBoxLayout( rightContainer ); - rightLayout->setMargin( 0 ); + rightLayout->setContentsMargins( 0, 0, 0, 0 ); rightLayout->setSpacing( 0 ); // KToolBar * rtb = new KToolBar( rightContainer, "mainToolBarSS" ); // rightLayout->addWidget( rtb ); @@ -537,7 +537,7 @@ m_cliPresentation(false), m_cliPrint(false), m_cliPrintAndExit(false), m_embedMo m_bottomBar = new QWidget( rightContainer ); QHBoxLayout * bottomBarLayout = new QHBoxLayout( m_bottomBar ); m_pageSizeLabel = new PageSizeLabel( m_bottomBar, m_document ); - bottomBarLayout->setMargin( 0 ); + bottomBarLayout->setContentsMargins( 0, 0, 0, 0 ); bottomBarLayout->setSpacing( 0 ); bottomBarLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); m_miniBarLogic = new MiniBarLogic( this, m_document ); @@ -2278,7 +2278,7 @@ class GotoPageDialog : public QDialog connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); QVBoxLayout *topLayout = new QVBoxLayout(this); - topLayout->setMargin(6); + topLayout->setContentsMargins(6, 6, 6, 6); QHBoxLayout *midLayout = new QHBoxLayout(); spinbox = new QSpinBox(this); spinbox->setRange(1, max); diff --git a/ui/annotationwidgets.cpp b/ui/annotationwidgets.cpp index 2b3bd4612..81d723e39 100644 --- a/ui/annotationwidgets.cpp +++ b/ui/annotationwidgets.cpp @@ -44,9 +44,9 @@ PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent, PreviewPosition : QWidget( parent ), m_previewPosition( position ) { QVBoxLayout * mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); QHBoxLayout * toplay = new QHBoxLayout( this ); - toplay->setMargin( 0 ); + toplay->setContentsMargins( 0, 0, 0, 0 ); mainlay->addLayout( toplay ); m_comboItems = new KComboBox( this ); toplay->addWidget( m_comboItems ); diff --git a/ui/annotwindow.cpp b/ui/annotwindow.cpp index e4d94b39e..53b8b5c3f 100644 --- a/ui/annotwindow.cpp +++ b/ui/annotwindow.cpp @@ -70,7 +70,7 @@ public: : QWidget( parent ) { QVBoxLayout * mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 0 ); // close button row QHBoxLayout * buttonlay = new QHBoxLayout(); @@ -220,7 +220,7 @@ AnnotWindow::AnnotWindow( QWidget * parent, Okular::Annotation * annot, Okular:: textEdit->setReadOnly(true); QVBoxLayout * mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 2 ); + mainlay->setContentsMargins( 2, 2, 2, 2 ); mainlay->setSpacing( 0 ); m_title = new MovableTitle( this ); mainlay->addWidget( m_title ); diff --git a/ui/bookmarklist.cpp b/ui/bookmarklist.cpp index 0c762a4e6..be25814a6 100644 --- a/ui/bookmarklist.cpp +++ b/ui/bookmarklist.cpp @@ -119,7 +119,7 @@ BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent ) : QWidget( parent ), m_document( document ), m_currentDocumentItem( nullptr ) { QVBoxLayout *mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 6 ); m_searchLine = new KTreeWidgetSearchLine( this ); diff --git a/ui/findbar.cpp b/ui/findbar.cpp index e3829b540..53c821438 100644 --- a/ui/findbar.cpp +++ b/ui/findbar.cpp @@ -29,7 +29,7 @@ FindBar::FindBar( Okular::Document * document, QWidget * parent ) , m_active( false ) { QHBoxLayout * lay = new QHBoxLayout( this ); - lay->setMargin( 2 ); + lay->setContentsMargins( 2, 2, 2, 2 ); QToolButton * closeBtn = new QToolButton( this ); closeBtn->setIcon( QIcon::fromTheme( QStringLiteral("dialog-close") ) ); diff --git a/ui/ktreeviewsearchline.cpp b/ui/ktreeviewsearchline.cpp index ba58775c9..2466adbec 100644 --- a/ui/ktreeviewsearchline.cpp +++ b/ui/ktreeviewsearchline.cpp @@ -383,7 +383,7 @@ void KTreeViewSearchLineWidget::createWidgets() QHBoxLayout* layout = new QHBoxLayout( this ); layout->setSpacing( 5 ); - layout->setMargin( 0 ); + layout->setContentsMargins( 0, 0, 0, 0 ); layout->addWidget( label ); layout->addWidget( d->searchLine ); } diff --git a/ui/layers.cpp b/ui/layers.cpp index 4c258ab16..4fab7c0ae 100644 --- a/ui/layers.cpp +++ b/ui/layers.cpp @@ -23,7 +23,7 @@ Layers::Layers(QWidget *parent, Okular::Document *document) : QWidget(parent), m_document(document) { QVBoxLayout * const mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 6 ); m_document->addObserver( this ); diff --git a/ui/minibar.cpp b/ui/minibar.cpp index 1185f63c3..dd86fbf2f 100644 --- a/ui/minibar.cpp +++ b/ui/minibar.cpp @@ -161,7 +161,7 @@ MiniBar::MiniBar( QWidget * parent, MiniBarLogic * miniBarLogic ) QHBoxLayout * horLayout = new QHBoxLayout( this ); - horLayout->setMargin( 0 ); + horLayout->setContentsMargins( 0, 0, 0, 0 ); horLayout->setSpacing( 3 ); QSize buttonSize( KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium ); diff --git a/ui/presentationsearchbar.cpp b/ui/presentationsearchbar.cpp index 1b11e1747..5c3b288a7 100644 --- a/ui/presentationsearchbar.cpp +++ b/ui/presentationsearchbar.cpp @@ -55,7 +55,7 @@ PresentationSearchBar::PresentationSearchBar( Okular::Document *document, QWidge setAutoFillBackground( true ); QHBoxLayout * lay = new QHBoxLayout( this ); - lay->setMargin( 0 ); + lay->setContentsMargins( 0, 0, 0, 0 ); m_handle = new HandleDrag( this ); lay->addWidget( m_handle ); diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp index 3ccfe04ab..22fdea83f 100644 --- a/ui/propertiesdialog.cpp +++ b/ui/propertiesdialog.cpp @@ -95,7 +95,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc) value = new QWidget( page ); /// place icon left of mime type's name QHBoxLayout *hboxLayout = new QHBoxLayout( value ); - hboxLayout->setMargin( 0 ); + hboxLayout->setContentsMargins( 0, 0, 0, 0 ); /// retrieve icon and place it in a QLabel QMimeDatabase db; QMimeType mimeType = db.mimeTypeForName( valueString ); diff --git a/ui/searchlineedit.cpp b/ui/searchlineedit.cpp index ea12d3543..155243064 100644 --- a/ui/searchlineedit.cpp +++ b/ui/searchlineedit.cpp @@ -281,7 +281,7 @@ SearchLineWidget::SearchLineWidget( QWidget * parent, Okular::Document * documen : QWidget( parent ) { QHBoxLayout *layout = new QHBoxLayout( this ); - layout->setMargin( 0 ); + layout->setContentsMargins( 0, 0, 0, 0 ); m_edit = new SearchLineEdit( this, document ); layout->addWidget( m_edit ); diff --git a/ui/searchwidget.cpp b/ui/searchwidget.cpp index 96fc16589..d96f0a215 100644 --- a/ui/searchwidget.cpp +++ b/ui/searchwidget.cpp @@ -31,7 +31,7 @@ SearchWidget::SearchWidget( QWidget * parent, Okular::Document * document ) setSizePolicy( sp ); QHBoxLayout * mainlay = new QHBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 3 ); // 2. text line diff --git a/ui/side_reviews.cpp b/ui/side_reviews.cpp index b98c5c321..f89699f96 100644 --- a/ui/side_reviews.cpp +++ b/ui/side_reviews.cpp @@ -89,7 +89,7 @@ Reviews::Reviews( QWidget * parent, Okular::Document * document ) { // create widgets and layout them vertically QVBoxLayout * vLayout = new QVBoxLayout( this ); - vLayout->setMargin( 0 ); + vLayout->setContentsMargins( 0, 0, 0, 0 ); vLayout->setSpacing( 6 ); m_view = new TreeView( m_document, this ); diff --git a/ui/sidebar.cpp b/ui/sidebar.cpp index 13bcf6eec..eec491cd8 100644 --- a/ui/sidebar.cpp +++ b/ui/sidebar.cpp @@ -469,7 +469,7 @@ Sidebar::Sidebar( QWidget *parent ) : QWidget( parent ), d( new Private ) { QHBoxLayout *mainlay = new QHBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 0 ); setAutoFillBackground( true ); diff --git a/ui/signaturepanel.cpp b/ui/signaturepanel.cpp index 3ee38e805..bdcb04c9d 100644 --- a/ui/signaturepanel.cpp +++ b/ui/signaturepanel.cpp @@ -54,7 +54,7 @@ SignaturePanel::SignaturePanel( Okular::Document *document, QWidget *parent ) connect( d->m_view, &QTreeView::customContextMenuRequested, this, &SignaturePanel::slotShowContextMenu ); auto vLayout = new QVBoxLayout( this ); - vLayout->setMargin( 0 ); + vLayout->setContentsMargins( 0, 0, 0, 0 ); vLayout->setSpacing( 6 ); vLayout->addWidget( d->m_view ); } diff --git a/ui/toc.cpp b/ui/toc.cpp index d913d27ba..990796380 100644 --- a/ui/toc.cpp +++ b/ui/toc.cpp @@ -30,7 +30,7 @@ TOC::TOC(QWidget *parent, Okular::Document *document) : QWidget(parent), m_document(document) { QVBoxLayout *mainlay = new QVBoxLayout( this ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 6 ); m_searchLine = new KTreeViewSearchLine( this ); diff --git a/ui/videowidget.cpp b/ui/videowidget.cpp index ac9707ff1..a9e4bc914 100644 --- a/ui/videowidget.cpp +++ b/ui/videowidget.cpp @@ -48,7 +48,7 @@ static QAction* createToolBarButtonWithWidgetPopup( QToolBar* toolBar, QWidget * QWidget *dummy = new QWidget( menu ); widgetAction->setDefaultWidget( dummy ); QVBoxLayout *dummyLayout = new QVBoxLayout( dummy ); - dummyLayout->setMargin( 5 ); + dummyLayout->setContentsMargins( 5, 5, 5, 5 ); dummyLayout->addWidget( widget ); menu->addAction( widgetAction ); return action; @@ -235,7 +235,7 @@ VideoWidget::VideoWidget( const Okular::Annotation *annotation, Okular::Movie *m QWidget *playerPage = new QWidget( this ); QVBoxLayout *mainlay = new QVBoxLayout( playerPage ); - mainlay->setMargin( 0 ); + mainlay->setContentsMargins( 0, 0, 0, 0 ); mainlay->setSpacing( 0 ); d->player = new Phonon::VideoPlayer( Phonon::NoCategory, playerPage );