Improve memory management
This commit is contained in:
@@ -225,7 +225,8 @@ void CurveItemModel::update()
|
|||||||
// CommonItemModels
|
// CommonItemModels
|
||||||
//
|
//
|
||||||
|
|
||||||
CommonItemModels::CommonItemModels(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent)
|
CommonItemModels::CommonItemModels(const GeneralSettings * const generalSettings, const ModelData * const modelData, QObject * parent) :
|
||||||
|
QObject(parent)
|
||||||
{
|
{
|
||||||
m_rawSourceItemModel = new RawSourceItemModel(generalSettings, modelData, parent);
|
m_rawSourceItemModel = new RawSourceItemModel(generalSettings, modelData, parent);
|
||||||
m_rawSwitchItemModel = new RawSwitchItemModel(generalSettings, modelData, parent);
|
m_rawSwitchItemModel = new RawSwitchItemModel(generalSettings, modelData, parent);
|
||||||
|
|||||||
@@ -742,7 +742,8 @@ GpsCoord extractGpsCoordinates(const QString & position)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
TableLayout::TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels)
|
TableLayout::TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels) :
|
||||||
|
QObject(parent)
|
||||||
{
|
{
|
||||||
#if defined(TABLE_LAYOUT)
|
#if defined(TABLE_LAYOUT)
|
||||||
tableWidget = new QTableWidget(parent);
|
tableWidget = new QTableWidget(parent);
|
||||||
|
|||||||
@@ -208,8 +208,9 @@ private:
|
|||||||
|
|
||||||
GpsCoord extractGpsCoordinates(const QString & position);
|
GpsCoord extractGpsCoordinates(const QString & position);
|
||||||
|
|
||||||
class TableLayout
|
class TableLayout: public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels);
|
TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels);
|
||||||
// ~TableLayout() ;
|
// ~TableLayout() ;
|
||||||
|
|||||||
@@ -190,8 +190,8 @@ void InputsPanel::gm_openExpo(int index)
|
|||||||
if (firmware->getCapability(VirtualInputs))
|
if (firmware->getCapability(VirtualInputs))
|
||||||
inputName = model->inputNames[ed.chn];
|
inputName = model->inputNames[ed.chn];
|
||||||
|
|
||||||
ExpoDialog *g = new ExpoDialog(this, *model, &ed, generalSettings, firmware, inputName, rawSourceFilteredModel, rawSwitchFilteredModel);
|
ExpoDialog *dlg = new ExpoDialog(this, *model, &ed, generalSettings, firmware, inputName, rawSourceFilteredModel, rawSwitchFilteredModel);
|
||||||
if (g->exec()) {
|
if (dlg->exec()) {
|
||||||
model->expoData[index] = ed;
|
model->expoData[index] = ed;
|
||||||
if (firmware->getCapability(VirtualInputs))
|
if (firmware->getCapability(VirtualInputs))
|
||||||
strncpy(model->inputNames[ed.chn], inputName.toLatin1().data(), INPUT_NAME_LEN);
|
strncpy(model->inputNames[ed.chn], inputName.toLatin1().data(), INPUT_NAME_LEN);
|
||||||
@@ -206,6 +206,7 @@ void InputsPanel::gm_openExpo(int index)
|
|||||||
expoInserted=false;
|
expoInserted=false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
delete dlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int InputsPanel::getExpoIndex(unsigned int dch)
|
int InputsPanel::getExpoIndex(unsigned int dch)
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ void MixesPanel::gm_openMix(int index)
|
|||||||
|
|
||||||
MixData mixd(model->mixData[index]);
|
MixData mixd(model->mixData[index]);
|
||||||
|
|
||||||
MixerDialog *g = new MixerDialog(this, *model, &mixd, generalSettings, firmware, rawSourceFilteredModel, rawSwitchFilteredModel);
|
MixerDialog *dlg = new MixerDialog(this, *model, &mixd, generalSettings, firmware, rawSourceFilteredModel, rawSwitchFilteredModel);
|
||||||
if(g->exec()) {
|
if(dlg->exec()) {
|
||||||
model->mixData[index] = mixd;
|
model->mixData[index] = mixd;
|
||||||
emit modified();
|
emit modified();
|
||||||
update();
|
update();
|
||||||
@@ -198,6 +198,7 @@ void MixesPanel::gm_openMix(int index)
|
|||||||
mixInserted = false;
|
mixInserted = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
delete dlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MixesPanel::getMixerIndex(unsigned int dch)
|
int MixesPanel::getMixerIndex(unsigned int dch)
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ TelemetrySensorPanel::TelemetrySensorPanel(QWidget *parent, SensorData & sensor,
|
|||||||
QFontMetrics *f = new QFontMetrics(QFont());
|
QFontMetrics *f = new QFontMetrics(QFont());
|
||||||
QSize sz;
|
QSize sz;
|
||||||
sz = f->size(Qt::TextSingleLine, "TELE00");
|
sz = f->size(Qt::TextSingleLine, "TELE00");
|
||||||
|
delete f;
|
||||||
ui->numLabel->setMinimumWidth(sz.width());
|
ui->numLabel->setMinimumWidth(sz.width());
|
||||||
ui->numLabel->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->numLabel->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
ui->numLabel->setToolTip(tr("Popup menu available"));
|
ui->numLabel->setToolTip(tr("Popup menu available"));
|
||||||
|
|||||||
Reference in New Issue
Block a user