23 #include <QDoubleSpinBox> 25 #include <libsigrokcxx/libsigrokcxx.hpp> 29 using boost::optional;
39 optional< pair<double, double> > range,
40 optional<double> step,
43 Property(name, desc, getter, setter),
61 Glib::VariantBase variant =
getter_();
64 }
catch (
const sigrok::Error &
e) {
65 qWarning() << tr(
"Querying config key %1 resulted in %2").arg(
name_, e.what());
80 connect(
spin_box_, SIGNAL(valueChanged(
double)),
91 Glib::VariantBase variant;
95 }
catch (
const sigrok::Error &
e) {
96 qWarning() << tr(
"Querying config key %1 resulted in %2").arg(
name_, e.what());
100 assert(variant.gobj());
102 double value = Glib::VariantBase::cast_dynamic<Glib::Variant<double>>(
const boost::optional< double > step_
const boost::optional< pair< double, double > > range_
void on_value_changed(double)
T value(details::expression_node< T > *n)
QWidget * get_widget(QWidget *parent, bool auto_commit)
Double(QString name, QString desc, int decimals, QString suffix, boost::optional< pair< double, double > > range, boost::optional< double > step, Getter getter, Setter setter)
QDoubleSpinBox * spin_box_
function< Glib::VariantBase()> Getter
function< void(Glib::VariantBase)> Setter