From add8262f72befc4c6a25403a21269030111054d1 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 27 Aug 2020 11:35:39 +0200 Subject: Remove QStyleOptionProgressBar::orientation member MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address ### Qt 6 comment; the information is already stored in the state variable, using the QStyle::State_Horizontal bit. Change-Id: I61d143ba057776f9d622793a0592b5dd4726f25d Reviewed-by: Qt CI Bot Reviewed-by: Tor Arne Vestbø --- src/widgets/widgets/qprogressbar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp index f94cbd3172..e2d4875f54 100644 --- a/src/widgets/widgets/qprogressbar.cpp +++ b/src/widgets/widgets/qprogressbar.cpp @@ -135,7 +135,6 @@ void QProgressBar::initStyleOption(QStyleOptionProgressBar *option) const option->textAlignment = d->alignment; option->textVisible = d->textVisible; option->text = text(); - option->orientation = d->orientation; // ### Qt 6: remove this member from QStyleOptionProgressBar option->invertedAppearance = d->invertedAppearance; option->bottomToTop = d->textDirection == QProgressBar::BottomToTop; } @@ -424,7 +423,7 @@ QSize QProgressBar::sizeHint() const initStyleOption(&opt); int cw = style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, this); QSize size = QSize(qMax(9, cw) * 7 + fm.horizontalAdvance(QLatin1Char('0')) * 4, fm.height() + 8); - if (opt.orientation == Qt::Vertical) + if (!(opt.state & QStyle::State_Horizontal)) size = size.transposed(); return style()->sizeFromContents(QStyle::CT_ProgressBar, &opt, size, this); } -- cgit v1.2.3