Commit db0f4771 authored by Laurent Montel's avatar Laurent Montel

Port deprecated QLayout::setMargin

parent 7f978806
......@@ -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 );
......
......@@ -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 );
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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") ) );
......
......@@ -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 );
}
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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 );
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment