Fix valgrind issues
This commit is contained in:
parent
1c6a1ab6fd
commit
75f4ee245f
@ -289,6 +289,9 @@ void AmplitudeCalDialog::AddPointDialog()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::AddAmplitudePointsDialog();
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->frequency->setUnit("Hz");
|
||||
ui->frequency->setPrefixes(" kMG");
|
||||
ui->startFreq->setUnit("Hz");
|
||||
@ -356,6 +359,9 @@ void AmplitudeCalDialog::AutomaticMeasurementDialog()
|
||||
automatic.dialog = new QDialog(this);
|
||||
auto ui = new Ui::AutomaticAmplitudeDialog();
|
||||
ui->setupUi(automatic.dialog);
|
||||
connect(automatic.dialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
automatic.progress = ui->progress;
|
||||
ui->explanation->setText(info);
|
||||
ui->status->setText("Gathering information about "+otherCal+" Calibration...");
|
||||
|
@ -674,7 +674,7 @@ void Marker::updateContextmenu()
|
||||
auto typemenu = contextmenu.addMenu("Type");
|
||||
auto typegroup = new QActionGroup(&contextmenu);
|
||||
for(auto t : getSupportedTypes()) {
|
||||
auto setTypeAction = new QAction(typeToString(t));
|
||||
auto setTypeAction = new QAction(typeToString(t), typemenu);
|
||||
setTypeAction->setCheckable(true);
|
||||
if(t == type) {
|
||||
setTypeAction->setChecked(true);
|
||||
@ -689,7 +689,7 @@ void Marker::updateContextmenu()
|
||||
auto table = contextmenu.addMenu("Data Format in Table");
|
||||
auto tablegroup = new QActionGroup(&contextmenu);
|
||||
for(auto f : applicableFormats()) {
|
||||
auto setFormatAction = new QAction(formatToString(f));
|
||||
auto setFormatAction = new QAction(formatToString(f), table);
|
||||
setFormatAction->setCheckable(true);
|
||||
if(f == formatTable) {
|
||||
setFormatAction->setChecked(true);
|
||||
@ -703,7 +703,7 @@ void Marker::updateContextmenu()
|
||||
|
||||
auto graph = contextmenu.addMenu("Show on Graph");
|
||||
for(auto f : applicableFormats()) {
|
||||
auto setFormatAction = new QAction(formatToString(f));
|
||||
auto setFormatAction = new QAction(formatToString(f), graph);
|
||||
setFormatAction->setCheckable(true);
|
||||
if(formatGraph.count(f)) {
|
||||
setFormatAction->setChecked(true);
|
||||
@ -753,7 +753,7 @@ void Marker::updateContextmenu()
|
||||
}
|
||||
if(group != nullptr) {
|
||||
// "remove from group" available
|
||||
auto removeGroup = new QAction("Remove from linked group");
|
||||
auto removeGroup = new QAction("Remove from linked group", &contextmenu);
|
||||
connect(removeGroup, &QAction::triggered, [=](){
|
||||
group->remove(this);
|
||||
});
|
||||
@ -765,7 +765,7 @@ void Marker::updateContextmenu()
|
||||
}
|
||||
|
||||
|
||||
auto deleteAction = new QAction("Delete");
|
||||
auto deleteAction = new QAction("Delete", &contextmenu);
|
||||
connect(deleteAction, &QAction::triggered, this, &Marker::deleteLater);
|
||||
contextmenu.addAction(deleteAction);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ MarkerWidget::MarkerWidget(MarkerModel &model, QWidget *parent) :
|
||||
}
|
||||
// multiple markers selected, execute group context menu
|
||||
QMenu menu;
|
||||
auto createGroup = new QAction("Link selected");
|
||||
auto createGroup = new QAction("Link selected", &menu);
|
||||
connect(createGroup, &QAction::triggered, [&](){
|
||||
auto g = model.createMarkerGroup();
|
||||
// assign markers to group
|
||||
@ -68,7 +68,7 @@ MarkerWidget::MarkerWidget(MarkerModel &model, QWidget *parent) :
|
||||
});
|
||||
menu.addAction(createGroup);
|
||||
if(anyInGroup) {
|
||||
auto removeGroup = new QAction("Break Links");
|
||||
auto removeGroup = new QAction("Break Links", &menu);
|
||||
connect(removeGroup, &QAction::triggered, [&](){
|
||||
// remove selected markers from groups if they are already assigned to one
|
||||
for(auto m : selected) {
|
||||
|
@ -42,6 +42,9 @@ void Math::DFT::edit()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::DFTDialog;
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->windowBox->setLayout(new QVBoxLayout);
|
||||
ui->windowBox->layout()->addWidget(window.createEditor());
|
||||
|
||||
@ -76,6 +79,9 @@ QWidget *Math::DFT::createExplanationWidget()
|
||||
auto w = new QWidget();
|
||||
auto ui = new Ui::DFTExplanationWidget;
|
||||
ui->setupUi(w);
|
||||
connect(w, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,9 @@ void Math::Expression::edit()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::ExpressionDialog;
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->expEdit->setText(exp);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, [=](){
|
||||
exp = ui->expEdit->text();
|
||||
@ -57,6 +60,9 @@ QWidget *Math::Expression::createExplanationWidget()
|
||||
auto w = new QWidget();
|
||||
auto ui = new Ui::ExpressionExplanationWidget;
|
||||
ui->setupUi(w);
|
||||
connect(w, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,9 @@ void MedianFilter::edit()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::MedianFilterDialog();
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->kernelSize->setValue(kernelSize);
|
||||
ui->sortingMethod->setCurrentIndex((int) order);
|
||||
|
||||
@ -52,6 +55,9 @@ QWidget *MedianFilter::createExplanationWidget()
|
||||
auto w = new QWidget();
|
||||
auto ui = new Ui::MedianFilterExplanationWidget;
|
||||
ui->setupUi(w);
|
||||
connect(w, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,9 @@ void TDR::edit()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::TDRDialog;
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->windowBox->setLayout(new QVBoxLayout);
|
||||
ui->windowBox->layout()->addWidget(window.createEditor());
|
||||
|
||||
@ -119,6 +122,9 @@ QWidget *TDR::createExplanationWidget()
|
||||
auto w = new QWidget();
|
||||
auto ui = new Ui::TDRExplanationWidget;
|
||||
ui->setupUi(w);
|
||||
connect(w, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,9 @@ void Math::TimeGate::edit()
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::TimeGateDialog();
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->graph->setGate(this);
|
||||
ui->windowBox->setLayout(new QVBoxLayout);
|
||||
ui->windowBox->layout()->addWidget(window.createEditor());
|
||||
@ -113,6 +116,9 @@ QWidget *Math::TimeGate::createExplanationWidget()
|
||||
auto w = new QWidget();
|
||||
auto ui = new Ui::TimeGateExplanationWidget;
|
||||
ui->setupUi(w);
|
||||
connect(w, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,9 @@ TraceMath::TypeInfo TraceMath::getInfo(TraceMath::Type type)
|
||||
ret.explanationWidget = new QWidget();
|
||||
auto ui = new Ui::TimeDomainGatingExplanationWidget;
|
||||
ui->setupUi(ret.explanationWidget);
|
||||
connect(ret.explanationWidget, &QWidget::destroyed, [=](){
|
||||
delete ui;
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -169,6 +169,9 @@ TraceEditDialog::TraceEditDialog(Trace &t, QWidget *parent) :
|
||||
auto d = new QDialog();
|
||||
auto ui = new Ui::NewTraceMathDialog();
|
||||
ui->setupUi(d);
|
||||
connect(d, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
for(int i = 0; i < (int) TraceMath::Type::Last;i++) {
|
||||
auto info = TraceMath::getInfo(static_cast<TraceMath::Type>(i));
|
||||
ui->list->addItem(info.name);
|
||||
|
@ -34,6 +34,9 @@ void Deembedding::startMeasurementDialog(bool S11, bool S12, bool S21, bool S22)
|
||||
auto ui = new Ui_DeembeddingMeasurementDialog;
|
||||
measurementUI = ui;
|
||||
ui->setupUi(measurementDialog);
|
||||
connect(measurementDialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
|
||||
// add the trace selector
|
||||
set<unsigned int> skip;
|
||||
@ -106,7 +109,8 @@ void Deembedding::startMeasurementDialog(bool S11, bool S12, bool S21, bool S22)
|
||||
|
||||
Deembedding::Deembedding(TraceModel &tm)
|
||||
: tm(tm),
|
||||
measuring(false)
|
||||
measuring(false),
|
||||
sweepPoints(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -71,6 +71,9 @@ void MatchingNetwork::edit()
|
||||
auto dialog = new QDialog();
|
||||
auto ui = new Ui::MatchingNetworkDialog();
|
||||
ui->setupUi(dialog);
|
||||
connect(dialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
dialog->setModal(true);
|
||||
|
||||
graph = new QWidget();
|
||||
|
@ -81,6 +81,9 @@ void PortExtension::edit()
|
||||
auto dialog = new QDialog();
|
||||
ui = new Ui::PortExtensionEditDialog();
|
||||
ui->setupUi(dialog);
|
||||
connect(dialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
|
||||
// set initial values
|
||||
ui->P1Enabled->setChecked(port1.enabled);
|
||||
|
@ -126,6 +126,9 @@ void TwoThru::edit()
|
||||
auto dialog = new QDialog();
|
||||
ui = new Ui::TwoThruDialog();
|
||||
ui->setupUi(dialog);
|
||||
connect(dialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->Z0->setUnit("Ω");
|
||||
ui->Z0->setPrecision(4);
|
||||
ui->Z0->setValue(Z0);
|
||||
|
@ -83,6 +83,9 @@ void TraceWidgetVNA::importDialog()
|
||||
auto dialog = new QDialog();
|
||||
auto ui = new Ui::s2pImportOptions;
|
||||
ui->setupUi(dialog);
|
||||
connect(dialog, &QDialog::finished, [=](){
|
||||
delete ui;
|
||||
});
|
||||
ui->applyCal->setEnabled(calAvailable);
|
||||
ui->deembed->setEnabled(deembedAvailable);
|
||||
bool applyCal = false;
|
||||
|
@ -53,6 +53,7 @@ VNA::VNA(AppWindow *window)
|
||||
: Mode(window, "Vector Network Analyzer"),
|
||||
SCPINode("VNA"),
|
||||
deembedding(traceModel),
|
||||
deembedding_active(false),
|
||||
central(new TileWidget(traceModel))
|
||||
{
|
||||
averages = 1;
|
||||
@ -60,6 +61,7 @@ VNA::VNA(AppWindow *window)
|
||||
calMeasuring = false;
|
||||
calDialog.reset();
|
||||
calEdited = false;
|
||||
settings.sweepType = SweepType::Frequency;
|
||||
|
||||
// Create default traces
|
||||
auto tS11 = new Trace("S11", Qt::yellow);
|
||||
@ -551,6 +553,8 @@ VNA::VNA(AppWindow *window)
|
||||
SetPoints(pref.Startup.DefaultSweep.points);
|
||||
if(pref.Startup.DefaultSweep.type == "Power Sweep") {
|
||||
SetSweepType(SweepType::Power);
|
||||
} else {
|
||||
SetSweepType(SweepType::Frequency);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user