X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fprop%2Fdouble.cpp;h=c1e776e1f6c890c21d9d435cbc66316d8976e528;hb=793f8096c486d0fba871227d9772a510f7496c08;hp=fdd9a44c06828ff64cf44d67a1b29e4b18268b99;hpb=b912c99cb1802b93baec288d4f44819437ee08fa;p=pulseview.git diff --git a/pv/prop/double.cpp b/pv/prop/double.cpp index fdd9a44..c1e776e 100644 --- a/pv/prop/double.cpp +++ b/pv/prop/double.cpp @@ -50,17 +50,19 @@ Double::Double(QString name, QWidget* Double::get_widget(QWidget *parent) { - if(_spin_box) + if (_spin_box) return _spin_box; _spin_box = new QDoubleSpinBox(parent); _spin_box->setDecimals(_decimals); _spin_box->setSuffix(_suffix); - if(_range) + if (_range) _spin_box->setRange(_range->first, _range->second); - if(_step) + if (_step) _spin_box->setSingleStep(*_step); + _spin_box->setValue(_getter ? _getter() : 0.0); + return _spin_box; } @@ -68,7 +70,7 @@ void Double::commit() { assert(_setter); - if(!_spin_box) + if (!_spin_box) return; _setter(_spin_box->value());