projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33666ec
)
pv::prop::Double: Do not create a widget if the initial value could not be retrieved
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 25 Jan 2014 12:06:11 +0000
(12:06 +0000)
committer
Bert Vermeulen
<bert@biot.com>
Sat, 25 Jan 2014 14:34:00 +0000
(15:34 +0100)
pv/prop/double.cpp
patch
|
blob
|
history
diff --git
a/pv/prop/double.cpp
b/pv/prop/double.cpp
index fa5e5688148bc8f07fe089f88ed3be161a1fab11..93b45d327362f93b12595a4249e154bcdac0bb14 100644
(file)
--- a/
pv/prop/double.cpp
+++ b/
pv/prop/double.cpp
@@
-55,6
+55,10
@@
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)
+ return NULL;
+
_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);
@@
-63,12
+67,8
@@
QWidget* Double::get_widget(QWidget *parent, bool auto_commit)
if (_step)
_spin_box->setSingleStep(*_step);
if (_step)
_spin_box->setSingleStep(*_step);
- GVariant *const value = _getter ? _getter() : NULL;
-
- if (value) {
- _spin_box->setValue(g_variant_get_double(value));
- g_variant_unref(value);
- }
+ _spin_box->setValue(g_variant_get_double(value));
+ g_variant_unref(value);
if (auto_commit)
connect(_spin_box, SIGNAL(valueChanged(double)),
if (auto_commit)
connect(_spin_box, SIGNAL(valueChanged(double)),