QxtSpanSlider Fusion style messed up

Issue #85 new
E.M. Stegehuis created an issue

With Fusion the groove on the left or top of the lower handle is highlighted by the Fusion style.

I use the Fusion style and than the groove was colored highlighted on the left side of the lower handle. My slider has a minimum value below 0 and therefor I noticed it.

This is an issue in the implementation of the QxtSpanSlider but only when a style is used that highlights a part of the groove. I solved it with next code change:

void QxtSpanSlider::paintEvent(QPaintEvent* event)
{
    Q_UNUSED(event);
    QStylePainter painter(this);

    // groove & ticks
    QStyleOptionSlider opt;
    qxt_d().initStyleOption(&opt);
    opt.sliderValue = qMin (0, minimum ());
    opt.sliderPosition = QStyle::sliderValueFromPosition (minimum (), maximum (), qMin (0, minimum ()), maximum () - minimum (), false);
    opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderTickmarks;
    painter.drawComplexControl(QStyle::CC_Slider, opt);

In this part the Groove and Ticks should be painted using the original Style. The Fusion style draws a highlighted part from the minimum till the handle. To prevent this I mimic the value of the slider to be equal to the minimum.

(Qt 5.2.1 Qxt 0.7)

Comments (0)

  1. Log in to comment