| 129 | } |
| 130 | |
| 131 | void QxtSpanSliderPrivate::handleMousePress(QPoint pos, QStyle::SubControl& control, int value, QxtSpanSlider::SpanHandle handle) { |
| 132 | QStyleOptionSlider opt; |
| 133 | initStyleOption(&opt, handle); |
| 134 | QxtSpanSlider* p = &qxt_p(); |
| 135 | const QStyle::SubControl oldControl = control; |
| 136 | control = p->style()->hitTestComplexControl(QStyle::CC_Slider, &opt, pos, p); |
| 137 | const QRect sr = p->style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, p); |
| 138 | if (control == QStyle::SC_SliderHandle) { |
| 139 | position = value; |
| 140 | offset = pick(pos - sr.topLeft()); |
| 141 | lastPressed = handle; |
| 142 | p->setSliderDown(true); |
| 143 | Q_EMIT p->sliderPressed(handle); |
| 144 | } |
| 145 | if (control != oldControl) |
| 146 | p->update(sr); |
| 147 | } |
| 148 | |
| 149 | void QxtSpanSliderPrivate::setupPainter(QPainter* painter, Qt::Orientation orientation, qreal x1, qreal y1, qreal x2, qreal y2) const { |
| 150 | QColor highlight = qxt_p().palette().color(QPalette::Highlight); |