diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-09 18:43:05 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-13 05:55:46 +0000 |
commit | 8cba096c2aa181b93887fa6f6086dee689dbf5ca (patch) | |
tree | 911a18b3f9625aecc79e46e33dbf7d15d6f08f07 /examples/widgets/painting | |
parent | d493f676a38f000dd9c22dee6eea2b5ae4291e0a (diff) |
QtBase: compile examples with QT_DISABLE_DEPRECATED_BEFORE=0x050d00
Replace deprecated functions to be able to compile examples with
QT_DISABLE_DEPRECATED_BEFORE=0x050d00
Change-Id: If6b8de31f526320d6a0e2a20bb5f8e26c77f2353
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/painting')
5 files changed, 13 insertions, 13 deletions
diff --git a/examples/widgets/painting/deform/pathdeform.cpp b/examples/widgets/painting/deform/pathdeform.cpp index 0eda76a831..64e81f8cab 100644 --- a/examples/widgets/painting/deform/pathdeform.cpp +++ b/examples/widgets/painting/deform/pathdeform.cpp @@ -150,7 +150,7 @@ void PathDeformControls::layoutForDesktop() QVBoxLayout * mainLayout = new QVBoxLayout(this); mainLayout->addWidget(mainGroup); - mainLayout->setMargin(0); + mainLayout->setContentsMargins(QMargins()); connect(radiusSlider, &QAbstractSlider::valueChanged, m_renderer, &PathDeformRenderer::setRadius); connect(deformSlider, &QAbstractSlider::valueChanged, m_renderer, &PathDeformRenderer::setIntensity); @@ -211,7 +211,7 @@ void PathDeformControls::layoutForSmallScreen() QGridLayout *mainGroupLayout = new QGridLayout(mainGroup); - mainGroupLayout->setMargin(0); + mainGroupLayout->setContentsMargins(QMargins()); mainGroupLayout->addWidget(radiusLabel, 0, 0, Qt::AlignRight); mainGroupLayout->addWidget(radiusSlider, 0, 1); mainGroupLayout->addWidget(deformLabel, 1, 0, Qt::AlignRight); diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp index a464eee3ff..b3304b4b6d 100644 --- a/examples/widgets/painting/fontsampler/mainwindow.cpp +++ b/examples/widgets/painting/fontsampler/mainwindow.cpp @@ -78,7 +78,7 @@ MainWindow::MainWindow(QWidget *parent) connect(fontTree, &QTreeWidget::itemChanged, this, &MainWindow::updateStyles); - fontTree->setItemSelected(fontTree->topLevelItem(0), true); + fontTree->topLevelItem(0)->setSelected(true); showFont(fontTree->topLevelItem(0)); } diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp index fd6eaeb0d9..7abaef771b 100644 --- a/examples/widgets/painting/gradients/gradients.cpp +++ b/examples/widgets/painting/gradients/gradients.cpp @@ -180,7 +180,7 @@ GradientEditor::GradientEditor(QWidget *parent) { QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setSpacing(1); - vbox->setMargin(1); + vbox->setContentsMargins(1, 1, 1, 1); m_red_shade = new ShadeWidget(ShadeWidget::RedShade, this); m_green_shade = new ShadeWidget(ShadeWidget::GreenShade, this); diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp index cad0b8732c..03e55bb2a2 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.cpp +++ b/examples/widgets/painting/pathstroke/pathstroke.cpp @@ -227,11 +227,11 @@ void PathStrokeControls::layoutForDesktop() penWidthLayout->addWidget(penWidth); QVBoxLayout * mainLayout = new QVBoxLayout(this); - mainLayout->setMargin(0); + mainLayout->setContentsMargins(QMargins()); mainLayout->addWidget(mainGroup); QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup); - mainGroupLayout->setMargin(3); + mainGroupLayout->setContentsMargins(3, 3, 3, 3); mainGroupLayout->addWidget(m_capGroup); mainGroupLayout->addWidget(m_joinGroup); mainGroupLayout->addWidget(m_styleGroup); @@ -270,10 +270,10 @@ void PathStrokeControls::layoutForSmallScreens() { createCommonControls(this); - m_capGroup->layout()->setMargin(0); - m_joinGroup->layout()->setMargin(0); - m_styleGroup->layout()->setMargin(0); - m_pathModeGroup->layout()->setMargin(0); + m_capGroup->layout()->setContentsMargins(QMargins()); + m_joinGroup->layout()->setContentsMargins(QMargins()); + m_styleGroup->layout()->setContentsMargins(QMargins()); + m_pathModeGroup->layout()->setContentsMargins(QMargins()); QPushButton* okBtn = new QPushButton(tr("OK"), this); okBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -313,7 +313,7 @@ void PathStrokeControls::layoutForSmallScreens() rightLayout->addWidget(m_pathModeGroup); QGridLayout *mainLayout = new QGridLayout(this); - mainLayout->setMargin(0); + mainLayout->setContentsMargins(QMargins()); // Add spacers around the form items so we don't look stupid at higher resolutions mainLayout->addItem(new QSpacerItem(0,0), 0, 0, 1, 4); diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp index 3df9d9a6dc..3fc461bbd2 100644 --- a/examples/widgets/painting/shared/arthurstyle.cpp +++ b/examples/widgets/painting/shared/arthurstyle.cpp @@ -443,9 +443,9 @@ void ArthurStyle::polish(QWidget *widget) if (widget->layout() && qobject_cast<QGroupBox *>(widget)) { if (widget->findChildren<QGroupBox *>().size() == 0) { widget->layout()->setSpacing(0); - widget->layout()->setMargin(12); + widget->layout()->setContentsMargins(12, 12, 12, 12); } else { - widget->layout()->setMargin(13); + widget->layout()->setContentsMargins(13, 13, 13, 13); } } |