summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qprogressbar.cpp')
-rw-r--r--src/widgets/widgets/qprogressbar.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 8034a0237a..5b06e75abe 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -107,10 +107,8 @@ void QProgressBarPrivate::resetLayoutItemMargins()
/*!
Initialize \a option with the values from this QProgressBar. This method is useful
- for subclasses when they need a QStyleOptionProgressBar or QStyleOptionProgressBarV2,
- but don't want to fill in all the information themselves. This function will check the version
- of the QStyleOptionProgressBar and fill in the additional values for a
- QStyleOptionProgressBarV2.
+ for subclasses when they need a QStyleOptionProgressBar,
+ but don't want to fill in all the information themselves.
\sa QStyleOption::initFrom()
*/
@@ -129,13 +127,9 @@ void QProgressBar::initStyleOption(QStyleOptionProgressBar *option) const
option->textAlignment = d->alignment;
option->textVisible = d->textVisible;
option->text = text();
-
- if (QStyleOptionProgressBarV2 *optionV2
- = qstyleoption_cast<QStyleOptionProgressBarV2 *>(option)) {
- optionV2->orientation = d->orientation; // ### Qt 6: remove this member from QStyleOptionProgressBarV2
- optionV2->invertedAppearance = d->invertedAppearance;
- optionV2->bottomToTop = (d->textDirection == QProgressBar::BottomToTop);
- }
+ option->orientation = d->orientation; // ### Qt 6: remove this member from QStyleOptionProgressBar
+ option->invertedAppearance = d->invertedAppearance;
+ option->bottomToTop = d->textDirection == QProgressBar::BottomToTop;
}
bool QProgressBarPrivate::repaintRequired() const
@@ -158,7 +152,7 @@ bool QProgressBarPrivate::repaintRequired() const
}
// Check if the bar needs to be repainted
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
q->initStyleOption(&opt);
int cw = q->style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, q);
QRect groove = q->style()->subElementRect(QStyle::SE_ProgressBarGroove, &opt, q);
@@ -410,7 +404,7 @@ Qt::Alignment QProgressBar::alignment() const
void QProgressBar::paintEvent(QPaintEvent *)
{
QStylePainter paint(this);
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
initStyleOption(&opt);
paint.drawControl(QStyle::CE_ProgressBar, opt);
d_func()->lastPaintedValue = d_func()->value;
@@ -423,7 +417,7 @@ QSize QProgressBar::sizeHint() const
{
ensurePolished();
QFontMetrics fm = fontMetrics();
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
initStyleOption(&opt);
int cw = style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, this);
QSize size = QSize(qMax(9, cw) * 7 + fm.width(QLatin1Char('0')) * 4, fm.height() + 8);