Update screenshot of main view
[weightgraph] / weightgraph / weightspinbox.h
1 #ifndef WEIGHTSPINBOX_H
2 #define WEIGHTSPINBOX_H
3
4 #include <QDoubleSpinBox>
5 #include "settings.h"
6
7 class WeightSpinBox : public QDoubleSpinBox
8 {
9   Q_OBJECT
10 public:
11   WeightSpinBox(QWidget *parent=0) : QDoubleSpinBox(parent)
12   {
13     setDecimals(1);
14     setSingleStep(0.1);
15     setMinimum(0.1);
16     setMaximum(999.9);
17     setValue(60.0);
18     updateWeightUnit();
19     connect(Settings::self(), SIGNAL(settingChanged()),
20             this, SLOT(updateWeightUnit()));
21   }
22 private slots:
23   void updateWeightUnit() {
24     setSuffix(" "+Settings::weightUnit());
25   }
26 };
27
28 #endif // WEIGHTSPINBOX_H