From 31ad607721f109363e1f0567dff66a715f53316d Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 8 Jun 2024 23:46:22 +0200 Subject: [PATCH] Fix memleaks Frees memory allocated in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2126 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2128 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2129 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2130 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2131 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2132 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2133 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2134 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2135 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2136 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2137 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2138 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2139 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2140 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2141 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2142 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2143 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2144 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2145 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2146 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2147 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2148 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2149 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2150 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2153 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2154 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2155 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2156 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2157 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2158 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2159 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2160 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2161 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2190 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2191 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2192 in RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI*, DeviceUISet*, BasebandSampleSink*, QWidget*) .../plugins/channelrx/radioastronomy/radioastronomygui.cpp:2193 and a comment :) --- .../radioastronomy/radioastronomygui.cpp | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.cpp b/plugins/channelrx/radioastronomy/radioastronomygui.cpp index 36e3bf574..d26eddbd4 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomygui.cpp @@ -2132,42 +2132,42 @@ RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI ui->powerTable->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->powerTable, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customContextMenuRequested(QPoint))); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TIME, new TimeDelegate()); - //ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER, new DecimalDelegate(6)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER_DB, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER_DBM, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TSYS, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TSYS0, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TSOURCE, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TB, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_TSKY, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_FLUX, new DecimalDelegate(2)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_SIGMA_T, new DecimalDelegate(2)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_SIGMA_S, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_RA, new HMSDelegate()); - ui->powerTable->setItemDelegateForColumn(POWER_COL_DEC, new DMSDelegate()); - ui->powerTable->setItemDelegateForColumn(POWER_COL_GAL_LAT, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_GAL_LON, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_AZ, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_EL, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_VBCRS, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_VLSR, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_AIR_TEMP, new DecimalDelegate(1)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_AZ, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_EL, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_AZ_OFF, new DecimalDelegate(0)); - ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_EL_OFF, new DecimalDelegate(0)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TIME, new TimeDelegate("hh:mm:ss", ui->powerTable)); + //ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER, new DecimalDelegate(6, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER_DB, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_POWER_DBM, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TSYS, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TSYS0, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TSOURCE, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TB, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_TSKY, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_FLUX, new DecimalDelegate(2, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_SIGMA_T, new DecimalDelegate(2, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_SIGMA_S, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_RA, new HMSDelegate(ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_DEC, new DMSDelegate(ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_GAL_LAT, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_GAL_LON, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_AZ, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_EL, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_VBCRS, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_VLSR, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_AIR_TEMP, new DecimalDelegate(1, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_AZ, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_EL, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_AZ_OFF, new DecimalDelegate(0, ui->powerTable)); + ui->powerTable->setItemDelegateForColumn(POWER_COL_ROT_EL_OFF, new DecimalDelegate(0, ui->powerTable)); resizeSpectrumMarkerTable(); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_FREQ, new DecimalDelegate(6)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_VALUE, new DecimalDelegate(1)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_DELTA_X, new DecimalDelegate(6)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_DELTA_Y, new DecimalDelegate(1)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_VR, new DecimalDelegate(2)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_R, new DecimalDelegate(1)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_D, new DecimalDelegate(1)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_R_MIN, new DecimalDelegate(1)); - ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_V, new DecimalDelegate(1)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_FREQ, new DecimalDelegate(6, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_VALUE, new DecimalDelegate(1, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_DELTA_X, new DecimalDelegate(6, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_DELTA_Y, new DecimalDelegate(1, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_VR, new DecimalDelegate(2, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_R, new DecimalDelegate(1, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_D, new DecimalDelegate(1, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_R_MIN, new DecimalDelegate(1, ui->spectrumMarkerTable)); + ui->spectrumMarkerTable->setItemDelegateForColumn(SPECTRUM_MARKER_COL_V, new DecimalDelegate(1, ui->spectrumMarkerTable)); // Create blank marker table ui->spectrumMarkerTable->setRowCount(SPECTRUM_MARKER_ROWS); // 1 peak and two markers @@ -2196,10 +2196,10 @@ RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI connect(ui->spectrumMarkerTable, &QTableWidget::itemChanged, this, &RadioAstronomyGUI::spectrumMarkerTableItemChanged); resizePowerMarkerTable(); - ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_TIME, new TimeDelegate()); - ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_VALUE, new DecimalDelegate(1)); - ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_DELTA_X, new TimeDeltaDelegate()); - ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_DELTA_Y, new DecimalDelegate(1)); + ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_TIME, new TimeDelegate("hh:mm:ss", ui->powerMarkerTable)); + ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_VALUE, new DecimalDelegate(1, ui->powerMarkerTable)); + ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_DELTA_X, new TimeDeltaDelegate(ui->powerMarkerTable)); + ui->powerMarkerTable->setItemDelegateForColumn(POWER_MARKER_COL_DELTA_Y, new DecimalDelegate(1, ui->powerMarkerTable)); // Create blank marker table ui->powerMarkerTable->setRowCount(POWER_MARKER_ROWS); // 1 peak and two markers