diff options
Diffstat (limited to 'src/widgets/styles/qandroidstyle.cpp')
-rw-r--r-- | src/widgets/styles/qandroidstyle.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index b37dffbe80..110153d0f6 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -1606,15 +1606,14 @@ void QAndroidStyle::AndroidProgressBarControl::drawControl(const QStyleOption *o if (!m_progressDrawable) return; - if (const QStyleOptionProgressBar *progressBarOption = - qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { + if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { if (m_progressDrawable->type() == QAndroidStyle::Layer) { - const double fraction = progressBarOption->progress / double(progressBarOption->maximum - progressBarOption->minimum); + const double fraction = double(qint64(pb->progress) - pb->minimum) / (qint64(pb->maximum) - pb->minimum); QAndroidStyle::AndroidDrawable *clipDrawable = static_cast<QAndroidStyle::AndroidLayerDrawable *>(m_progressDrawable)->layer(m_progressId); if (clipDrawable->type() == QAndroidStyle::Clip) - static_cast<AndroidClipDrawable *>(clipDrawable)->setFactor(fraction, progressBarOption->orientation); + static_cast<AndroidClipDrawable *>(clipDrawable)->setFactor(fraction, pb->orientation); else - static_cast<AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, fraction, progressBarOption->orientation); + static_cast<AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, fraction, pb->orientation); } m_progressDrawable->draw(p, option); } |