vna.cpp - cosmetic change

siunitedit.cpp - keep text onFocus
tracewidget.cpp - invalid index or empty list
This commit is contained in:
Zoran Kostic 2020-11-23 03:32:18 +01:00
parent 53e587b4b8
commit 0e2395cf55
3 changed files with 25 additions and 8 deletions

View file

@ -36,7 +36,11 @@ void TraceWidget::on_add_clicked()
void TraceWidget::on_remove_clicked()
{
model.removeTrace(ui->view->currentIndex().row());
QModelIndex index = ui->view->currentIndex();
if (index.isValid()) { // if nothing clicked, index.row() = -1
model.removeTrace(index.row());
// otherwise, TraceModel casts index to unsigned int and compares with traces.size() which is int
};
}
bool TraceWidget::eventFilter(QObject *, QEvent *event)