! \reimp */
| 667 | \reimp |
| 668 | */ |
| 669 | void QxtSpanSlider::paintEvent(QPaintEvent*) { |
| 670 | QStylePainter painter(this); |
| 671 | |
| 672 | // groove & ticks |
| 673 | QStyleOptionSlider opt; |
| 674 | qxt_d().initStyleOption(&opt); |
| 675 | opt.sliderValue = 0; |
| 676 | opt.sliderPosition = 0; |
| 677 | opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderTickmarks; |
| 678 | painter.drawComplexControl(QStyle::CC_Slider, opt); |
| 679 | |
| 680 | // handle rects |
| 681 | opt.sliderPosition = qxt_d().lowerPos; |
| 682 | const QRect lr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this); |
| 683 | const int lrv = qxt_d().pick(lr.center()); |
| 684 | opt.sliderPosition = qxt_d().upperPos; |
| 685 | const QRect ur = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this); |
| 686 | const int urv = qxt_d().pick(ur.center()); |
| 687 | |
| 688 | // span |
| 689 | const int minv = qMin(lrv, urv); |
| 690 | const int maxv = qMax(lrv, urv); |
| 691 | const QPoint c = QRect(lr.center(), ur.center()).center(); |
| 692 | QRect spanRect; |
| 693 | if (orientation() == Qt::Horizontal) |
| 694 | spanRect = QRect(QPoint(minv, c.y() - 2), QPoint(maxv, c.y() + 1)); |
| 695 | else |
| 696 | spanRect = QRect(QPoint(c.x() - 2, minv), QPoint(c.x() + 1, maxv)); |
| 697 | qxt_d().drawSpan(&painter, spanRect); |
| 698 | |
| 699 | // handles |
| 700 | qxt_d().drawHandle(&painter, QxtSpanSlider::UpperHandle); |
| 701 | qxt_d().drawHandle(&painter, QxtSpanSlider::LowerHandle); |
| 702 | } |
nothing calls this directly
no test coverage detected