Make member variable underscores a suffix instead of a prefix
[pulseview.git] / pv / prop / double.h
index 19cbe2c185e99ad0b0e35b3f653fd3c912eae67c..dc4c6ec9c0de86e8d4f28b3cdf715fb9d2a23c12 100644 (file)
@@ -22,7 +22,6 @@
 #define PULSEVIEW_PV_PROP_DOUBLE_H
 
 #include <utility>
-#include <vector>
 
 #include <boost/optional.hpp>
 
@@ -35,26 +34,31 @@ namespace prop {
 
 class Double : public Property
 {
+       Q_OBJECT
+
 public:
        Double(QString name, int decimals, QString suffix,
                boost::optional< std::pair<double, double> > range,
                boost::optional<double> step,
-               boost::function<double ()> getter,
-               boost::function<void (double)> setter);
+               Getter getter,
+               Setter setter);
+
+       virtual ~Double();
 
-       QWidget* get_widget(QWidget *parent);
+       QWidget* get_widget(QWidget *parent, bool auto_commit);
 
        void commit();
 
+private Q_SLOTS:
+       void on_value_changed(double);
+
 private:
-       const int _decimals;
-       const QString _suffix;
-       const boost::optional< std::pair<double, double> > _range;
-       const boost::optional<double> _step;
-       boost::function<double ()> _getter;
-       boost::function<void (double)> _setter;
-
-       QDoubleSpinBox *_spin_box;
+       const int decimals_;
+       const QString suffix_;
+       const boost::optional< std::pair<double, double> > range_;
+       const boost::optional<double> step_;
+
+       QDoubleSpinBox *spin_box_;
 };
 
 } // prop