diff --git a/examples/gallery/content/Controls.qml b/examples/gallery/content/Controls.qml index d40a66b76de759a3ba093abc1a1dee52be416fa6..9a2b8a7446047509a95d42e2ceec33422eb4cfef 100644 --- a/examples/gallery/content/Controls.qml +++ b/examples/gallery/content/Controls.qml @@ -132,7 +132,7 @@ Item { CheckBox { id: tickmarkCheck text: "Tickmarks" - checked: true + checked: false KeyNavigation.tab: r1 } } diff --git a/src/private/qstyleitem.cpp b/src/private/qstyleitem.cpp index 22ffcf54a11eb21526b0f2045f87463f53bae1c4..eca2deab915367c9b1b4d0042344680ce9d08e31 100644 --- a/src/private/qstyleitem.cpp +++ b/src/private/qstyleitem.cpp @@ -436,15 +436,16 @@ void QStyleItem::initStyleOption() qreal numOfSteps = (opt->maximum - opt->minimum) / opt->singleStep; // at least 5 pixels between tick marks if (numOfSteps && (width() / numOfSteps < 5)) - opt->tickInterval = qRound((5*numOfSteps / width()) + 0.5)*step(); + opt->tickInterval = qRound((5 * numOfSteps / width()) + 0.5) * step(); else opt->tickInterval = opt->singleStep; + } else // default Qt-components implementation opt->tickInterval = opt->maximum != opt->minimum ? 1200 / (opt->maximum - opt->minimum) : 0; opt->sliderValue = value(); opt->subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle; - opt->tickPosition = (activeControl() == "tick" ? + opt->tickPosition = (activeControl() == "ticks" ? QSlider::TicksBelow : QSlider::NoTicks); if (opt->tickPosition != QSlider::NoTicks) opt->subControls |= QStyle::SC_SliderTickmarks; diff --git a/src/styles/Desktop/SliderStyle.qml b/src/styles/Desktop/SliderStyle.qml index 26d55024797fd0556a724852d04c259a98d70d4e..7f551a3b7fc471d02133aad265552f16692929b4 100644 --- a/src/styles/Desktop/SliderStyle.qml +++ b/src/styles/Desktop/SliderStyle.qml @@ -56,5 +56,5 @@ StyleItem { enabled: control.enabled hasFocus: control.focus hints: control.styleHints - activeControl: tickmarksEnabled ? tickPosition.toLowerCase() : "" + activeControl: control.tickmarksEnabled ? "ticks" : "" }