NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ruleslider.h
1 // Widget to control one rule
2 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
3 
4 #ifndef RULESLIDER_H
5 #define RULESLIDER_H
6 
7 #include <QWidget>
8 #include <QPushButton>
9 #include <QHBoxLayout>
10 #include <QDoubleSpinBox>
11 #include <QSlider>
12 #include <QLabel>
13 
14 class RuleSlider : public QWidget
15 {
16 Q_OBJECT
17 public:
18  RuleSlider(const int rule_id, const std::string name, QWidget *parent = 0);
19  virtual ~RuleSlider();
20 
21 Q_SIGNALS:
22  void applyRule(double delta, int rule_id);
23 
24 private Q_SLOTS:
25  void sliderChanged();
26  void spinChanged();
27  void setZero();
28 
29 private:
30  void handleValueChange(double new_value);
31 
32 private:
33  QHBoxLayout *m_layout;
34  QDoubleSpinBox *m_spin;
35  QSlider *m_slider;
36  QLabel *m_name_label;
37  QPushButton *m_zero_button;
38 
39  int m_rule_id;
40  double m_prev_value;
41 };
42 
43 
44 #endif // RULESLIDER_H