From 9b9c63c27d6f9945d0b662a4a931750d775e1955 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 25 Oct 2013 16:34:33 +0300 Subject: Android: Fix the QSlider handler position. Change-Id: I300f187a94d6c2b6b385c5a129150344f6b805ea Reviewed-by: Paul Olav Tvete --- src/widgets/styles/qandroidstyle.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index afd6c3024c..9595e49f40 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -696,7 +696,10 @@ int QAndroidStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option, { switch (hint) { case SH_Slider_AbsoluteSetButtons: - return 1; + return Qt::LeftButton; + + case SH_Slider_PageSetButtons: + return 0; case SH_RequestSoftwareInputPanel: return RSIP_OnMouseClick; @@ -1776,9 +1779,9 @@ QRect QAndroidStyle::AndroidSeekBarControl::subControlRect(const QStyleOptionCom drawable = static_cast(m_seekBarThumb)->bestAndroidStateMatch(option); QRect r(option->rect); - double factor = double(styleOption->sliderPosition/(styleOption->maximum-styleOption->minimum)); - int pos=(double(option->rect.width()*factor - drawable->size().width()) / 2); - r.setX(r.x()+pos); + double factor = double(styleOption->sliderPosition) / (styleOption->maximum - styleOption->minimum); + int pos = option->rect.width() * factor - double(drawable->size().width() / 2); + r.setX(r.x() + pos); r.setSize(drawable->size()); return r; } -- cgit v1.2.3