summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-11-02 16:42:21 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-11-04 14:17:14 +0000
commit765362db78c2508744775f7a4e5bb64085934f55 (patch)
tree015ff0de6c8b2b50e95c0da5b3159431fe5f5e63 /src/widgets/widgets/qprogressbar.cpp
parent5c57c66d98554f91ce34df387ffc2da18189cf2c (diff)
QtWidgets: remove use of obsolete QStyleOption*V<N>
They are obsolete since Qt 5.0. Change-Id: I3a1ee314126bd245a3c788ac7af49905ab50945f Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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);