From 26a226630443a20bb2d3015431c019614e33a061 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 18 Jun 2020 19:59:41 +0200 Subject: Remove deprecated QStyleOption::init() Even it was not marked as deprecated the replacement function initFrom() is available since Qt4 times (and init() is deprecated since then) Change-Id: I09a4ebbf66b01fbe7aec67691dc68d2e42d1cd78 Reviewed-by: Volker Hilsheimer --- .../widgets/itemviews/qtreewidget/tst_qtreewidget.cpp | 2 +- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 18 +++++++++--------- .../styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 2 +- .../widgets/qabstractslider/tst_qabstractslider.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index 009086eebd..74cf514c12 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -3327,7 +3327,7 @@ void tst_QTreeWidget::task239150_editorWidth() QTreeWidget tree; QStyleOptionFrame opt; - opt.init(&tree); + opt.initFrom(&tree); const int minWidth = tree.style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(0, 0) , nullptr).width(); diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 3b7495fda8..049760eae5 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -190,7 +190,7 @@ bool tst_QStyle::testAllFunctions(QStyle *style) { QStyleOption opt; QWidget testWidget; - opt.init(&testWidget); + opt.initFrom(&testWidget); testWidget.setStyle(style); @@ -218,24 +218,24 @@ bool tst_QStyle::testAllFunctions(QStyle *style) QPixmap surface(QSize(200, 200)); QPainter painter(&surface); QStyleOptionComboBox copt1; - copt1.init(&testWidget); + copt1.initFrom(&testWidget); QStyleOptionGroupBox copt2; - copt2.init(&testWidget); + copt2.initFrom(&testWidget); QStyleOptionSizeGrip copt3; - copt3.init(&testWidget); + copt3.initFrom(&testWidget); QStyleOptionSlider copt4; - copt4.init(&testWidget); + copt4.initFrom(&testWidget); copt4.minimum = 0; copt4.maximum = 100; copt4.tickInterval = 25; copt4.sliderValue = 50; QStyleOptionSpinBox copt5; - copt5.init(&testWidget); + copt5.initFrom(&testWidget); QStyleOptionTitleBar copt6; - copt6.init(&testWidget); + copt6.initFrom(&testWidget); QStyleOptionToolButton copt7; - copt7.init(&testWidget); + copt7.initFrom(&testWidget); QStyleOptionComplex copt9; copt9.initFrom(&testWidget); @@ -538,7 +538,7 @@ void tst_QStyle::testProxyCalled() QToolButton b; b.setArrowType(Qt::DownArrow); QStyleOptionToolButton opt; - opt.init(&b); + opt.initFrom(&b); opt.features |= QStyleOptionToolButton::Arrow; QPixmap surface(QSize(200, 200)); QPainter painter(&surface); diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 82527849b0..14c8d1772d 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -1918,7 +1918,7 @@ void tst_QStyleSheetStyle::QTBUG15910_crashNullWidget() void paintEvent(QPaintEvent *) override { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, nullptr); style()->drawPrimitive(QStyle::PE_Frame, &opt, &p, nullptr); diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index c54a6bb73e..a9a8945877 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -1818,7 +1818,7 @@ void tst_QAbstractSlider::sliderPressedReleased() slider->activateWindow(); QStyleOptionSlider option; - option.init(slider); + option.initFrom(slider); option.upsideDown = control == QStyle::CC_Slider ? !slider->invertedAppearance() : slider->invertedAppearance(); option.subControls = QStyle::SC_None; -- cgit v1.2.3