#include <RockSlider.h>
Inherits QSlider.
|
| void | addMarker (int position, std::string comment="") |
| |
Definition at line 7 of file RockSlider.h.
◆ RockSlider()
| RockSlider::RockSlider |
( |
QWidget * |
parent | ) |
|
◆ ~RockSlider()
| RockSlider::~RockSlider |
( |
| ) |
|
◆ addMarker
| void RockSlider::addMarker |
( |
int |
position, |
|
|
std::string |
comment = "" |
|
) |
| |
|
slot |
Definition at line 16 of file RockSlider.cc.
18 e.position = position;
std::vector< Entry > markers
◆ paint_p()
| void RockSlider::paint_p |
( |
QPainter * |
painter | ) |
|
|
protected |
Definition at line 44 of file RockSlider.cc.
46 QStyleOptionSlider opt;
47 initStyleOption(&opt);
48 QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove,
this);
51 for(
int i=0;i<
markers.size();i++){
53 if(orientation() == Qt::Horizontal){
54 painter->drawLine(pos,gr.top(),pos,gr.bottom());
56 painter->drawLine(gr.left(),pos,gr.right(),pos);
int rangeValueToPixelPos(int pos) const
std::vector< Entry > markers
◆ paintEvent()
| void RockSlider::paintEvent |
( |
QPaintEvent * |
e | ) |
|
|
protected |
Definition at line 62 of file RockSlider.cc.
64 QSlider::paintEvent(e);
void paint_p(QPainter *painter)
◆ rangeValueToPixelPos()
| int RockSlider::rangeValueToPixelPos |
( |
int |
pos | ) |
const |
|
protected |
Definition at line 23 of file RockSlider.cc.
25 QStyleOptionSlider opt;
26 initStyleOption(&opt);
27 QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove,
this);
28 QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle,
this);
29 int sliderMin, sliderMax, sliderLength;
31 if (orientation() == Qt::Horizontal) {
32 sliderLength = sr.width();
34 sliderMax = gr.right() - sliderLength + 1;
36 sliderLength = sr.height();
38 sliderMax = gr.bottom() - sliderLength + 1;
41 return QStyle::sliderPositionFromValue(minimum(), maximum(), pos, sliderMax - sliderMin, opt.upsideDown) + sliderLength/2.0;
◆ markers
| std::vector<Entry> RockSlider::markers |
|
protected |
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/RockSlider.h
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/RockSlider.cc