MCPcopy Create free account
hub / github.com/KDE/labplot / handleMousePress

Method handleMousePress

src/frontend/widgets/qxtspanslider.cpp:131–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void 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
149void 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);

Callers 1

mousePressEventMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected