Commit 29549da6 authored by Giovanni Di Siena's avatar Giovanni Di Siena
Browse files

Re #25299 qt modernize-use-auto

parent aaf83ba1
...@@ -58,7 +58,7 @@ EnggDiffGSASFittingViewQtWidget::~EnggDiffGSASFittingViewQtWidget() { ...@@ -58,7 +58,7 @@ EnggDiffGSASFittingViewQtWidget::~EnggDiffGSASFittingViewQtWidget() {
void EnggDiffGSASFittingViewQtWidget::addWidget( void EnggDiffGSASFittingViewQtWidget::addWidget(
IEnggDiffMultiRunFittingWidgetView *widget) { IEnggDiffMultiRunFittingWidgetView *widget) {
QWidget *qWidget = dynamic_cast<QWidget *>(widget); auto *qWidget = dynamic_cast<QWidget *>(widget);
m_ui.gridLayout_multiRunWidget->addWidget(qWidget, 0, 0); m_ui.gridLayout_multiRunWidget->addWidget(qWidget, 0, 0);
} }
......
...@@ -827,8 +827,7 @@ void EnggDiffractionPresenter::startAsyncCalibWorker( ...@@ -827,8 +827,7 @@ void EnggDiffractionPresenter::startAsyncCalibWorker(
const std::string &ceriaNo, const std::string &specNos) { const std::string &ceriaNo, const std::string &specNos) {
delete m_workerThread; delete m_workerThread;
m_workerThread = new QThread(this); m_workerThread = new QThread(this);
EnggDiffWorker *worker = auto *worker = new EnggDiffWorker(this, outFilename, vanNo, ceriaNo, specNos);
new EnggDiffWorker(this, outFilename, vanNo, ceriaNo, specNos);
worker->moveToThread(m_workerThread); worker->moveToThread(m_workerThread);
connect(m_workerThread, SIGNAL(started()), worker, SLOT(calibrate())); connect(m_workerThread, SIGNAL(started()), worker, SLOT(calibrate()));
...@@ -1939,7 +1938,7 @@ void EnggDiffractionPresenter::startAsyncRebinningTimeWorker( ...@@ -1939,7 +1938,7 @@ void EnggDiffractionPresenter::startAsyncRebinningTimeWorker(
delete m_workerThread; delete m_workerThread;
m_workerThread = new QThread(this); m_workerThread = new QThread(this);
EnggDiffWorker *worker = new EnggDiffWorker(this, runNo, bin, outWSName); auto *worker = new EnggDiffWorker(this, runNo, bin, outWSName);
worker->moveToThread(m_workerThread); worker->moveToThread(m_workerThread);
connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinTime())); connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinTime()));
...@@ -2029,8 +2028,7 @@ void EnggDiffractionPresenter::startAsyncRebinningPulsesWorker( ...@@ -2029,8 +2028,7 @@ void EnggDiffractionPresenter::startAsyncRebinningPulsesWorker(
delete m_workerThread; delete m_workerThread;
m_workerThread = new QThread(this); m_workerThread = new QThread(this);
EnggDiffWorker *worker = auto *worker = new EnggDiffWorker(this, runNo, nperiods, timeStep, outWSName);
new EnggDiffWorker(this, runNo, nperiods, timeStep, outWSName);
worker->moveToThread(m_workerThread); worker->moveToThread(m_workerThread);
connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinPulses())); connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinPulses()));
...@@ -2390,8 +2388,8 @@ std::string EnggDiffractionPresenter::TOFFitWorkspaceFactory( ...@@ -2390,8 +2388,8 @@ std::string EnggDiffractionPresenter::TOFFitWorkspaceFactory(
const std::vector<double> &tzero, const std::string &specNo, const std::vector<double> &tzero, const std::string &specNo,
const std::string &customisedBankName) const { const std::string &customisedBankName) const {
size_t bank1 = size_t(0); auto bank1 = size_t(0);
size_t bank2 = size_t(1); auto bank2 = size_t(1);
std::string pyRange; std::string pyRange;
std::string plotSpecNum = "False"; std::string plotSpecNum = "False";
......
...@@ -162,7 +162,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) { ...@@ -162,7 +162,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) {
m_uiForm.twCurrentData->insertRow(currentRows); m_uiForm.twCurrentData->insertRow(currentRows);
// Insert the colour selector // Insert the colour selector
QComboBox *colourCombo = new QComboBox(); auto *colourCombo = new QComboBox();
// Add colours // Add colours
colourCombo->addItem("Black", QVariant(Qt::black)); colourCombo->addItem("Black", QVariant(Qt::black));
colourCombo->addItem("Red", QVariant(Qt::red)); colourCombo->addItem("Red", QVariant(Qt::red));
...@@ -189,12 +189,12 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) { ...@@ -189,12 +189,12 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) {
m_uiForm.twCurrentData->setCellWidget(currentRows, COLOUR, colourCombo); m_uiForm.twCurrentData->setCellWidget(currentRows, COLOUR, colourCombo);
// Insert the workspace name // Insert the workspace name
QTableWidgetItem *wsNameItem = new QTableWidgetItem(tr(wsName.c_str())); auto *wsNameItem = new QTableWidgetItem(tr(wsName.c_str()));
wsNameItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); wsNameItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_uiForm.twCurrentData->setItem(currentRows, WORKSPACE_NAME, wsNameItem); m_uiForm.twCurrentData->setItem(currentRows, WORKSPACE_NAME, wsNameItem);
// Insert the spectra offset // Insert the spectra offset
QSpinBox *offsetSpin = new QSpinBox(); auto *offsetSpin = new QSpinBox();
offsetSpin->setMinimum(0); offsetSpin->setMinimum(0);
offsetSpin->setMaximum(INT_MAX); offsetSpin->setMaximum(INT_MAX);
connect(offsetSpin, SIGNAL(valueChanged(int)), this, connect(offsetSpin, SIGNAL(valueChanged(int)), this,
...@@ -202,7 +202,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) { ...@@ -202,7 +202,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) {
m_uiForm.twCurrentData->setCellWidget(currentRows, SPEC_OFFSET, offsetSpin); m_uiForm.twCurrentData->setCellWidget(currentRows, SPEC_OFFSET, offsetSpin);
// Insert the current displayed spectra // Insert the current displayed spectra
QTableWidgetItem *currentSpecItem = new QTableWidgetItem(tr("n/a")); auto *currentSpecItem = new QTableWidgetItem(tr("n/a"));
currentSpecItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); currentSpecItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_uiForm.twCurrentData->setItem(currentRows, CURRENT_SPEC, currentSpecItem); m_uiForm.twCurrentData->setItem(currentRows, CURRENT_SPEC, currentSpecItem);
} }
...@@ -242,7 +242,7 @@ int DataComparison::getInitialColourIndex() { ...@@ -242,7 +242,7 @@ int DataComparison::getInitialColourIndex() {
// Build a list of used colours // Build a list of used colours
QList<int> usedColours; QList<int> usedColours;
for (int row = 0; row < numRows - 1; row++) { for (int row = 0; row < numRows - 1; row++) {
QComboBox *colourSelector = dynamic_cast<QComboBox *>( auto *colourSelector = dynamic_cast<QComboBox *>(
m_uiForm.twCurrentData->cellWidget(row, COLOUR)); m_uiForm.twCurrentData->cellWidget(row, COLOUR));
int index = colourSelector->currentIndex(); int index = colourSelector->currentIndex();
usedColours << index; usedColours << index;
...@@ -378,7 +378,7 @@ void DataComparison::plotWorkspaces() { ...@@ -378,7 +378,7 @@ void DataComparison::plotWorkspaces() {
if (m_curves.contains(workspaceName)) if (m_curves.contains(workspaceName))
m_curves[workspaceName]->attach(nullptr); m_curves[workspaceName]->attach(nullptr);
QComboBox *colourSelector = dynamic_cast<QComboBox *>( auto *colourSelector = dynamic_cast<QComboBox *>(
m_uiForm.twCurrentData->cellWidget(row, COLOUR)); m_uiForm.twCurrentData->cellWidget(row, COLOUR));
QColor curveColour = QColor curveColour =
colourSelector->itemData(colourSelector->currentIndex()) colourSelector->itemData(colourSelector->currentIndex())
...@@ -414,7 +414,7 @@ void DataComparison::normaliseSpectraOffsets() { ...@@ -414,7 +414,7 @@ void DataComparison::normaliseSpectraOffsets() {
// Find the lowest offset in the data table // Find the lowest offset in the data table
for (int row = 0; row < numRows; row++) { for (int row = 0; row < numRows; row++) {
QSpinBox *specOffsetSpin = dynamic_cast<QSpinBox *>( auto *specOffsetSpin = dynamic_cast<QSpinBox *>(
m_uiForm.twCurrentData->cellWidget(row, SPEC_OFFSET)); m_uiForm.twCurrentData->cellWidget(row, SPEC_OFFSET));
int specOffset = specOffsetSpin->value(); int specOffset = specOffsetSpin->value();
if (specOffset < lowestOffset) if (specOffset < lowestOffset)
...@@ -424,7 +424,7 @@ void DataComparison::normaliseSpectraOffsets() { ...@@ -424,7 +424,7 @@ void DataComparison::normaliseSpectraOffsets() {
// Subtract the lowest offset from all offsets to ensure at least one offset // Subtract the lowest offset from all offsets to ensure at least one offset
// is zero // is zero
for (int row = 0; row < numRows; row++) { for (int row = 0; row < numRows; row++) {
QSpinBox *specOffsetSpin = dynamic_cast<QSpinBox *>( auto *specOffsetSpin = dynamic_cast<QSpinBox *>(
m_uiForm.twCurrentData->cellWidget(row, SPEC_OFFSET)); m_uiForm.twCurrentData->cellWidget(row, SPEC_OFFSET));
int specOffset = specOffsetSpin->value(); int specOffset = specOffsetSpin->value();
specOffset -= lowestOffset; specOffset -= lowestOffset;
......
...@@ -576,7 +576,7 @@ void MantidEV::selectWorkspace_slot() { ...@@ -576,7 +576,7 @@ void MantidEV::selectWorkspace_slot() {
std::string axisCORELLI = std::string axisCORELLI =
m_uiForm.axisCORELLI_cmbx->currentText().toStdString(); m_uiForm.axisCORELLI_cmbx->currentText().toStdString();
RunLoadAndConvertToMD *runner = new RunLoadAndConvertToMD( auto *runner = new RunLoadAndConvertToMD(
worker, file_name, ev_ws_name, md_ws_name, modQ, minQ, maxQ, worker, file_name, ev_ws_name, md_ws_name, modQ, minQ, maxQ,
m_uiForm.LorentzCorrection_ckbx->isChecked(), m_uiForm.LorentzCorrection_ckbx->isChecked(),
m_uiForm.loadDataGroupBox->isChecked(), load_det_cal, det_cal_file, m_uiForm.loadDataGroupBox->isChecked(), load_det_cal, det_cal_file,
...@@ -722,7 +722,7 @@ void MantidEV::findPeaks_slot() { ...@@ -722,7 +722,7 @@ void MantidEV::findPeaks_slot() {
m_uiForm.SelectEventWorkspace_ledt->text().trimmed().toStdString(); m_uiForm.SelectEventWorkspace_ledt->text().trimmed().toStdString();
std::string file_name = std::string file_name =
m_uiForm.EventFileName_ledt->text().trimmed().toStdString(); m_uiForm.EventFileName_ledt->text().trimmed().toStdString();
RunFindPeaks *runner = new RunFindPeaks( auto *runner = new RunFindPeaks(
worker, ev_ws_name, md_ws_name, peaks_ws_name, max_abc, num_to_find, worker, ev_ws_name, md_ws_name, peaks_ws_name, max_abc, num_to_find,
min_intensity, minQPeaks, maxQPeaks, file_name); min_intensity, minQPeaks, maxQPeaks, file_name);
...@@ -903,7 +903,7 @@ void MantidEV::findUB_slot() { ...@@ -903,7 +903,7 @@ void MantidEV::findUB_slot() {
if (!getPositiveDouble(m_uiForm.max_pred_dspacing_ledt, max_pred_dspacing)) if (!getPositiveDouble(m_uiForm.max_pred_dspacing_ledt, max_pred_dspacing))
return; return;
RunPredictPeaks *runner = auto *runner =
new RunPredictPeaks(worker, peaks_ws_name, min_pred_wl, max_pred_wl, new RunPredictPeaks(worker, peaks_ws_name, min_pred_wl, max_pred_wl,
min_pred_dspacing, max_pred_dspacing); min_pred_dspacing, max_pred_dspacing);
...@@ -1137,7 +1137,7 @@ void MantidEV::integratePeaks_slot() { ...@@ -1137,7 +1137,7 @@ void MantidEV::integratePeaks_slot() {
if (!getDouble(m_uiForm.AdaptiveQMult_ledt, adaptiveQMult)) if (!getDouble(m_uiForm.AdaptiveQMult_ledt, adaptiveQMult))
return; return;
RunSphereIntegrate *runner = new RunSphereIntegrate( auto *runner = new RunSphereIntegrate(
worker, peaks_ws_name, event_ws_name, peak_radius, inner_radius, worker, peaks_ws_name, event_ws_name, peak_radius, inner_radius,
outer_radius, integrate_edge, use_cylinder_integration, cylinder_length, outer_radius, integrate_edge, use_cylinder_integration, cylinder_length,
cylinder_percent_bkg, cylinder_profile_fit, adaptive_background, cylinder_percent_bkg, cylinder_profile_fit, adaptive_background,
...@@ -1155,7 +1155,7 @@ void MantidEV::integratePeaks_slot() { ...@@ -1155,7 +1155,7 @@ void MantidEV::integratePeaks_slot() {
if (!getPositiveDouble(m_uiForm.NBadEdgePixels_ledt, n_bad_edge_pix)) if (!getPositiveDouble(m_uiForm.NBadEdgePixels_ledt, n_bad_edge_pix))
return; return;
RunFitIntegrate *runner = auto *runner =
new RunFitIntegrate(worker, peaks_ws_name, event_ws_name, rebin_params, new RunFitIntegrate(worker, peaks_ws_name, event_ws_name, rebin_params,
(size_t)n_bad_edge_pix, use_ikeda_carpenter); (size_t)n_bad_edge_pix, use_ikeda_carpenter);
...@@ -1183,7 +1183,7 @@ void MantidEV::integratePeaks_slot() { ...@@ -1183,7 +1183,7 @@ void MantidEV::integratePeaks_slot() {
return; return;
} }
RunEllipsoidIntegrate *runner = new RunEllipsoidIntegrate( auto *runner = new RunEllipsoidIntegrate(
worker, peaks_ws_name, event_ws_name, region_radius, specify_size, worker, peaks_ws_name, event_ws_name, region_radius, specify_size,
peak_size, inner_size, outer_size); peak_size, inner_size, outer_size);
......
...@@ -191,12 +191,12 @@ void SampleTransmission::algorithmComplete(bool error) { ...@@ -191,12 +191,12 @@ void SampleTransmission::algorithmComplete(bool error) {
// Fill the output table // Fill the output table
double scattering = ws->y(1)[0]; double scattering = ws->y(1)[0];
QTreeWidgetItem *scatteringItem = new QTreeWidgetItem(); auto *scatteringItem = new QTreeWidgetItem();
scatteringItem->setText(0, "Scattering"); scatteringItem->setText(0, "Scattering");
scatteringItem->setText(1, QString::number(scattering)); scatteringItem->setText(1, QString::number(scattering));
m_uiForm.twResults->addTopLevelItem(scatteringItem); m_uiForm.twResults->addTopLevelItem(scatteringItem);
QTreeWidgetItem *transmissionItem = new QTreeWidgetItem(); auto *transmissionItem = new QTreeWidgetItem();
transmissionItem->setText(0, "Transmission"); transmissionItem->setText(0, "Transmission");
m_uiForm.twResults->addTopLevelItem(transmissionItem); m_uiForm.twResults->addTopLevelItem(transmissionItem);
transmissionItem->setExpanded(true); transmissionItem->setExpanded(true);
......
...@@ -166,7 +166,7 @@ void SANSAddFiles::setToolTips() { ...@@ -166,7 +166,7 @@ void SANSAddFiles::setToolTips() {
* @return a pointer to the inserted widget * @return a pointer to the inserted widget
*/ */
QListWidgetItem *SANSAddFiles::insertListFront(const QString &text) { QListWidgetItem *SANSAddFiles::insertListFront(const QString &text) {
QListWidgetItem *newItem = new QListWidgetItem(text); auto *newItem = new QListWidgetItem(text);
newItem->setFlags(newItem->flags() | Qt::ItemIsEditable); newItem->setFlags(newItem->flags() | Qt::ItemIsEditable);
m_SANSForm->toAdd_List->insertItem(0, newItem); m_SANSForm->toAdd_List->insertItem(0, newItem);
return newItem; return newItem;
......
...@@ -411,7 +411,7 @@ void SANSPlotSpecial::setupTable() { ...@@ -411,7 +411,7 @@ void SANSPlotSpecial::setupTable() {
m_derivatives["Intercept"] = new QTableWidgetItem(*m_emptyCell); m_derivatives["Intercept"] = new QTableWidgetItem(*m_emptyCell);
m_derivatives["Chi Squared"] = new QTableWidgetItem(*m_emptyCell); m_derivatives["Chi Squared"] = new QTableWidgetItem(*m_emptyCell);
QTableWidgetItem *lbl = new QTableWidgetItem(*m_emptyCell); auto *lbl = new QTableWidgetItem(*m_emptyCell);
lbl->setText("Gradient"); lbl->setText("Gradient");
m_uiForm.tbDerived->setItem(0, SANSPlotSpecial::FitInformation, lbl); m_uiForm.tbDerived->setItem(0, SANSPlotSpecial::FitInformation, lbl);
m_uiForm.tbDerived->setItem(0, SANSPlotSpecial::FitInformationValues, m_uiForm.tbDerived->setItem(0, SANSPlotSpecial::FitInformationValues,
......
...@@ -47,11 +47,11 @@ void FunctionTemplateBrowser::createBrowser() { ...@@ -47,11 +47,11 @@ void FunctionTemplateBrowser::createBrowser() {
m_parameterManager = new ParameterPropertyManager(this, true); m_parameterManager = new ParameterPropertyManager(this, true);
// create editor factories // create editor factories
QtSpinBoxFactory *spinBoxFactory = new QtSpinBoxFactory(this); auto *spinBoxFactory = new QtSpinBoxFactory(this);
DoubleEditorFactory *doubleEditorFactory = new DoubleEditorFactory(this); auto *doubleEditorFactory = new DoubleEditorFactory(this);
QtLineEditFactory *lineEditFactory = new QtLineEditFactory(this); auto *lineEditFactory = new QtLineEditFactory(this);
QtCheckBoxFactory *checkBoxFactory = new QtCheckBoxFactory(this); auto *checkBoxFactory = new QtCheckBoxFactory(this);
QtEnumEditorFactory *comboBoxFactory = new QtEnumEditorFactory(this); auto *comboBoxFactory = new QtEnumEditorFactory(this);
auto *doubleDialogFactory = new DoubleDialogEditorFactory(this, true); auto *doubleDialogFactory = new DoubleDialogEditorFactory(this, true);
m_browser = new QtTreePropertyBrowser(nullptr, QStringList(), false); m_browser = new QtTreePropertyBrowser(nullptr, QStringList(), false);
...@@ -88,7 +88,7 @@ void FunctionTemplateBrowser::createBrowser() { ...@@ -88,7 +88,7 @@ void FunctionTemplateBrowser::createBrowser() {
void FunctionTemplateBrowser::init() { void FunctionTemplateBrowser::init() {
createBrowser(); createBrowser();
createProperties(); createProperties();
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_browser); layout->addWidget(m_browser);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
} }
......
...@@ -51,7 +51,7 @@ ISISCalibration::ISISCalibration(IndirectDataReduction *idrUI, QWidget *parent) ...@@ -51,7 +51,7 @@ ISISCalibration::ISISCalibration(IndirectDataReduction *idrUI, QWidget *parent)
m_uiForm.ppCalibration->watchADS(false); m_uiForm.ppCalibration->watchADS(false);
m_uiForm.ppResolution->watchADS(false); m_uiForm.ppResolution->watchADS(false);
DoubleEditorFactory *doubleEditorFactory = new DoubleEditorFactory(); auto *doubleEditorFactory = new DoubleEditorFactory();
// CAL PROPERTY TREE // CAL PROPERTY TREE
m_propTrees["CalPropTree"] = new QtTreePropertyBrowser(); m_propTrees["CalPropTree"] = new QtTreePropertyBrowser();
......
...@@ -39,8 +39,8 @@ ISISDiagnostics::ISISDiagnostics(IndirectDataReduction *idrUI, QWidget *parent) ...@@ -39,8 +39,8 @@ ISISDiagnostics::ISISDiagnostics(IndirectDataReduction *idrUI, QWidget *parent)
m_uiForm.properties->addWidget(m_propTrees["SlicePropTree"]); m_uiForm.properties->addWidget(m_propTrees["SlicePropTree"]);
// Editor Factories // Editor Factories
DoubleEditorFactory *doubleEditorFactory = new DoubleEditorFactory(); auto *doubleEditorFactory = new DoubleEditorFactory();
QtCheckBoxFactory *checkboxFactory = new QtCheckBoxFactory(); auto *checkboxFactory = new QtCheckBoxFactory();
m_propTrees["SlicePropTree"]->setFactoryForManager(m_dblManager, m_propTrees["SlicePropTree"]->setFactoryForManager(m_dblManager,
doubleEditorFactory); doubleEditorFactory);
m_propTrees["SlicePropTree"]->setFactoryForManager(m_blnManager, m_propTrees["SlicePropTree"]->setFactoryForManager(m_blnManager,
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
void setModelData(QWidget *editor, QAbstractItemModel *model, void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const override { const QModelIndex &index) const override {
QLineEdit *lineEdit = static_cast<QLineEdit *>(editor); auto *lineEdit = static_cast<QLineEdit *>(editor);
model->setData(index, lineEdit->text(), Qt::EditRole); model->setData(index, lineEdit->text(), Qt::EditRole);
} }
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
void setModelData(QWidget *editor, QAbstractItemModel *model, void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const override { const QModelIndex &index) const override {
QLineEdit *lineEdit = static_cast<QLineEdit *>(editor); auto *lineEdit = static_cast<QLineEdit *>(editor);
model->setData(index, lineEdit->text(), Qt::EditRole); model->setData(index, lineEdit->text(), Qt::EditRole);
} }
......
...@@ -46,7 +46,7 @@ IndirectSymmetrise::IndirectSymmetrise(IndirectDataReduction *idrUI, ...@@ -46,7 +46,7 @@ IndirectSymmetrise::IndirectSymmetrise(IndirectDataReduction *idrUI,
m_uiForm.propertiesPreview->addWidget(m_propTrees["SymmPVPropTree"]); m_uiForm.propertiesPreview->addWidget(m_propTrees["SymmPVPropTree"]);
// Editor Factories // Editor Factories
DoubleEditorFactory *doubleEditorFactory = new DoubleEditorFactory(); auto *doubleEditorFactory = new DoubleEditorFactory();
m_propTrees["SymmPropTree"]->setFactoryForManager(m_dblManager, m_propTrees["SymmPropTree"]->setFactoryForManager(m_dblManager,
doubleEditorFactory); doubleEditorFactory);
......
...@@ -157,7 +157,7 @@ void ALCBaselineModellingView::setSectionRow( ...@@ -157,7 +157,7 @@ void ALCBaselineModellingView::setSectionRow(
void ALCBaselineModellingView::addSectionSelector( void ALCBaselineModellingView::addSectionSelector(
int index, IALCBaselineModellingView::SectionSelector values) { int index, IALCBaselineModellingView::SectionSelector values) {
RangeSelector *newSelector = new RangeSelector(m_ui.dataPlot); auto *newSelector = new RangeSelector(m_ui.dataPlot);
if (index % 3 == 0) { if (index % 3 == 0) {
newSelector->setColour(Qt::blue); newSelector->setColour(Qt::blue);
......
...@@ -283,10 +283,8 @@ std::vector<int> MuonGroupingHelper::whichPairToWhichRow() const { ...@@ -283,10 +283,8 @@ std::vector<int> MuonGroupingHelper::whichPairToWhichRow() const {
continue; continue;
// test if content in combo boxes // test if content in combo boxes
QComboBox *qwF = auto *qwF = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 1));
static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 1)); auto *qwB = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 2));
QComboBox *qwB =
static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 2));
if (!qwF || !qwB) if (!qwF || !qwB)
continue; continue;
if (qwF->count() < 2 || qwB->count() < 2) if (qwF->count() < 2 || qwB->count() < 2)
......
...@@ -1089,8 +1089,7 @@ void MuonAnalysis::updatePairTable() { ...@@ -1089,8 +1089,7 @@ void MuonAnalysis::updatePairTable() {
} }
// get previous number of groups as listed in the pair comboboxes // get previous number of groups as listed in the pair comboboxes
QComboBox *qwF = auto *qwF = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(0, 1));
static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(0, 1));
int previousNumGroups = int previousNumGroups =
qwF->count(); // how many groups listed in pair combobox qwF->count(); // how many groups listed in pair combobox
int newNumGroups = numGroups(); int newNumGroups = numGroups();
...@@ -1098,8 +1097,7 @@ void MuonAnalysis::updatePairTable() { ...@@ -1098,8 +1097,7 @@ void MuonAnalysis::updatePairTable() {
// reset context of combo boxes // reset context of combo boxes
for (int i = 0; i < m_uiForm.pairTable->rowCount(); i++) { for (int i = 0; i < m_uiForm.pairTable->rowCount(); i++) {
qwF = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 1)); qwF = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 1));
QComboBox *qwB = auto *qwB = static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 2));
static_cast<QComboBox *>(m_uiForm.pairTable->cellWidget(i, 2));
if (previousNumGroups < newNumGroups) { if (previousNumGroups < newNumGroups) {
// then need to increase the number of entrees in combo box // then need to increase the number of entrees in combo box
...@@ -1468,9 +1466,9 @@ void MuonAnalysis::guessAlphaClicked() { ...@@ -1468,9 +1466,9 @@ void MuonAnalysis::guessAlphaClicked() {
m_updating = true; m_updating = true;
if (getPairNumberFromRow(m_pairTableRowInFocus) >= 0) { if (getPairNumberFromRow(m_pairTableRowInFocus) >= 0) {
QComboBox *qwF = static_cast<QComboBox *>( auto *qwF = static_cast<QComboBox *>(
m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 1)); m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 1));
QComboBox *qwB = static_cast<QComboBox *>( auto *qwB = static_cast<QComboBox *>(
m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 2)); m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 2));
if (!qwF || !qwB) if (!qwF || !qwB)
...@@ -1512,7 +1510,7 @@ void MuonAnalysis::guessAlphaClicked() { ...@@ -1512,7 +1510,7 @@ void MuonAnalysis::guessAlphaClicked() {
const QString alpha = QString::number(alphaValue); const QString alpha = QString::number(alphaValue);
QComboBox *qwAlpha = static_cast<QComboBox *>( auto *qwAlpha = static_cast<QComboBox *>(
m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 3)); m_uiForm.pairTable->cellWidget(m_pairTableRowInFocus, 3));
if (qwAlpha) if (qwAlpha)
m_uiForm.pairTable->item(m_pairTableRowInFocus, 3)->setText(alpha); m_uiForm.pairTable->item(m_pairTableRowInFocus, 3)->setText(alpha);
...@@ -2189,7 +2187,7 @@ void MuonAnalysis::startUpLook() { ...@@ -2189,7 +2187,7 @@ void MuonAnalysis::startUpLook() {
for (int i = 0; i < m_uiForm.groupTable->rowCount(); i++) { for (int i = 0; i < m_uiForm.groupTable->rowCount(); i++) {
QTableWidgetItem *item = m_uiForm.groupTable->item(i, 2); QTableWidgetItem *item = m_uiForm.groupTable->item(i, 2);
if (!item) { if (!item) {
QTableWidgetItem *it = new QTableWidgetItem(""); auto *it = new QTableWidgetItem("");
it->setFlags(it->flags() & (~Qt::ItemIsEditable)); it->setFlags(it->flags() & (~Qt::ItemIsEditable));
m_uiForm.groupTable->setItem(i, 2, it); m_uiForm.groupTable->setItem(i, 2, it);
} else { } else {
...@@ -2197,7 +2195,7 @@ void MuonAnalysis::startUpLook() { ...@@ -2197,7 +2195,7 @@ void MuonAnalysis::startUpLook() {
} }
item = m_uiForm.groupTable->item(i, 0); item = m_uiForm.groupTable->item(i, 0);
if (!item) { if (!item) {
QTableWidgetItem *it = new QTableWidgetItem(""); auto *it = new QTableWidgetItem("");
m_uiForm.groupTable->setItem(i, 0, it); m_uiForm.groupTable->setItem(i, 0, it);
} }
} }
......
...@@ -111,18 +111,18 @@ void MuonAnalysisResultTableTab::helpResultsClicked() { ...@@ -111,18 +111,18 @@ void MuonAnalysisResultTableTab::helpResultsClicked() {
void MuonAnalysisResultTableTab::selectAllLogs(bool state) { void MuonAnalysisResultTableTab::selectAllLogs(bool state) {
if (state) { if (state) {
for (int i = 0; i < m_uiForm.valueTable->rowCount(); i++) { for (int i = 0; i < m_uiForm.valueTable->rowCount(); i++) {
QTableWidgetItem *temp = auto *temp =
static_cast<QTableWidgetItem *>(m_uiForm.valueTable->item(i, 0)); static_cast<QTableWidgetItem *>(m_uiForm.valueTable->item(i, 0));
// If there is an item there then check the box // If there is an item there then check the box
if (temp != nullptr) { if (temp != nullptr) {
QCheckBox *includeCell = auto *includeCell =
static_cast<QCheckBox *>(m_uiForm.valueTable->cellWidget(i, 1)); static_cast<QCheckBox *>(m_uiForm.valueTable->cellWidget(i, 1));
includeCell->setChecked(true); includeCell->setChecked(true);
} }
} }
} else { } else {
for (int i = 0; i < m_uiForm.valueTable->rowCount(); i