#define PULSEVIEW_PV_PROP_DOUBLE_H
#include <utility>
-#include <vector>
#include <boost/optional.hpp>
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 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;
};