YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
sliderWithTarget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
7#ifndef SLIDER_WITH_TARGET_H
8#define SLIDER_WITH_TARGET_H
9
10#include <QWidget>
11#include <QSlider>
12#include <QLabel>
13#include <QTimer>
14#include <QStyleOptionSlider>
15#include <yarp/conf/compiler.h>
16
17class SliderWithTarget : public QSlider
18{
19public:
20 bool enableViewLabel = true;
25 SliderWithTarget(QWidget * parent = 0);
27 void updateSliderTarget(double val);
28 void resetTarget();
29 void setSliderStep(double val);
30 double getSliderStep();
31 void setValue(double val);
32 void setIsDouble(bool b);
33 bool getIsDouble();
34
35protected:
37 QLabel* sliderCurrentLabel = nullptr;
38 QLabel* sliderTargetLabel = nullptr;
39 double target;
41 double sliderStep = 1;
42 void paintEvent(QPaintEvent *ev) override;
43 void mousePressEvent(QMouseEvent * event) override;
44};
45
46
47#endif // JOINTITEM_H
void mousePressEvent(QMouseEvent *event) override
void setIsDouble(bool b)
void updateSliderTarget(double val)
void setSliderStep(double val)
void paintEvent(QPaintEvent *ev) override
void setValue(double val)
QLabel * sliderCurrentLabel