mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 22:17:31 +00:00
Bugfix: prevent crash on empty input
This commit is contained in:
parent
3055564a27
commit
4deaddf5d3
4 changed files with 27 additions and 27 deletions
|
|
@ -499,11 +499,11 @@ SIUnitEdit *TraceMarker::getSettingsEditor()
|
|||
case Type::Noise:
|
||||
case Type::PhaseNoise:
|
||||
default:
|
||||
return new SIUnitEdit("Hz", " kMG");
|
||||
return new SIUnitEdit("Hz", " kMG", 6);
|
||||
case Type::Lowpass:
|
||||
case Type::Highpass:
|
||||
case Type::PeakTable:
|
||||
return new SIUnitEdit("db", " ");
|
||||
return new SIUnitEdit("db", " ", 3);
|
||||
case Type::TOI:
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptio
|
|||
e->setMaximumHeight(rowHeight);
|
||||
e->setParent(parent);
|
||||
connect(e, &SIUnitEdit::valueUpdated, this, &MarkerSettingsDelegate::commitData);
|
||||
connect(e, &SIUnitEdit::editingAborted, [=](){
|
||||
connect(e, &SIUnitEdit::focusLost, [=](){
|
||||
marker->editingFrequeny = false;
|
||||
});
|
||||
}
|
||||
|
|
@ -327,7 +327,6 @@ void MarkerSettingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *m
|
|||
{
|
||||
auto markerModel = (TraceMarkerModel*) model;
|
||||
auto marker = markerModel->markerFromIndex(index);
|
||||
marker->editingFrequeny = false;
|
||||
auto si = (SIUnitEdit*) editor;
|
||||
markerModel->setData(index, si->value());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue