projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use libsigrok C++ bindings (patch version 7).
[pulseview.git]
/
pv
/
prop
/
double.cpp
diff --git
a/pv/prop/double.cpp
b/pv/prop/double.cpp
index 93b45d327362f93b12595a4249e154bcdac0bb14..54540bc68ded41c0575c3202726ac383665b5814 100644
(file)
--- a/
pv/prop/double.cpp
+++ b/
pv/prop/double.cpp
@@
-55,10
+55,16
@@
QWidget* Double::get_widget(QWidget *parent, bool auto_commit)
if (_spin_box)
return _spin_box;
if (_spin_box)
return _spin_box;
- GVariant *const value = _getter ? _getter() : NULL;
- if (!value)
+ if (!_getter)
return NULL;
return NULL;
+ Glib::VariantBase variant = _getter();
+ if (!variant.gobj())
+ return NULL;
+
+ double value = Glib::VariantBase::cast_dynamic<Glib::Variant<double>>(
+ variant).get();
+
_spin_box = new QDoubleSpinBox(parent);
_spin_box->setDecimals(_decimals);
_spin_box->setSuffix(_suffix);
_spin_box = new QDoubleSpinBox(parent);
_spin_box->setDecimals(_decimals);
_spin_box->setSuffix(_suffix);
@@
-67,8
+73,7
@@
QWidget* Double::get_widget(QWidget *parent, bool auto_commit)
if (_step)
_spin_box->setSingleStep(*_step);
if (_step)
_spin_box->setSingleStep(*_step);
- _spin_box->setValue(g_variant_get_double(value));
- g_variant_unref(value);
+ _spin_box->setValue(value);
if (auto_commit)
connect(_spin_box, SIGNAL(valueChanged(double)),
if (auto_commit)
connect(_spin_box, SIGNAL(valueChanged(double)),
@@
-84,7
+89,7
@@
void Double::commit()
if (!_spin_box)
return;
if (!_spin_box)
return;
- _setter(
g_variant_new_doubl
e(_spin_box->value()));
+ _setter(
Glib::Variant<double>::creat
e(_spin_box->value()));
}
void Double::on_value_changed(double)
}
void Double::on_value_changed(double)