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

Re #25299 qt modernize-use-auto

parent aaf83ba1
......@@ -57,7 +57,7 @@ void XIntegrationScrollBar::mouseMoveEvent(QMouseEvent *e) {
* @param e :: event
*/
bool XIntegrationScrollBar::eventFilter(QObject *object, QEvent *e) {
QPushButton *slider = dynamic_cast<QPushButton *>(object);
auto *slider = dynamic_cast<QPushButton *>(object);
if (!slider)
return false;
if (e->type() == QEvent::Leave) {
......@@ -66,7 +66,7 @@ bool XIntegrationScrollBar::eventFilter(QObject *object, QEvent *e) {
}
return true;
} else if (e->type() == QEvent::MouseButtonPress) {
QMouseEvent *me = static_cast<QMouseEvent *>(e);
auto *me = static_cast<QMouseEvent *>(e);
m_x = me->x();
m_width = m_slider->width();
if (m_x < m_resizeMargin) {
......@@ -85,7 +85,7 @@ bool XIntegrationScrollBar::eventFilter(QObject *object, QEvent *e) {
}
m_changed = false;
} else if (e->type() == QEvent::MouseMove) {
QMouseEvent *me = static_cast<QMouseEvent *>(e);
auto *me = static_cast<QMouseEvent *>(e);
int x = me->x();
int w = m_slider->width();
if (x < m_resizeMargin || x > w - m_resizeMargin) {
......@@ -179,7 +179,7 @@ XIntegrationControl::XIntegrationControl(InstrumentWidget *instrWindow)
: QFrame(instrWindow), m_instrWindow(instrWindow), m_totalMinimum(0),
m_totalMaximum(1), m_minimum(0), m_maximum(1) {
m_scrollBar = new XIntegrationScrollBar(this);
QHBoxLayout *layout = new QHBoxLayout();
auto *layout = new QHBoxLayout();
m_minText = new QLineEdit(this);
m_minText->setMaximumWidth(100);
m_minText->setToolTip("Minimum x value");
......
......@@ -55,7 +55,7 @@ DraggableColorBarWidget::DraggableColorBarWidget(QWidget *parent,
connect(m_maxValueBox, SIGNAL(editingFinished()), this,
SLOT(maxValueChanged()));
QVBoxLayout *lColormapLayout = new QVBoxLayout;
auto *lColormapLayout = new QVBoxLayout;
lColormapLayout->addWidget(m_maxValueBox);
lColormapLayout->addWidget(m_scaleWidget);
lColormapLayout->addWidget(m_minValueBox);
......@@ -76,7 +76,7 @@ DraggableColorBarWidget::DraggableColorBarWidget(QWidget *parent,
connect(m_dspnN, SIGNAL(valueChanged(double)), this,
SLOT(nPowerChanged(double)));
QGridLayout *options_layout = new QGridLayout;
auto *options_layout = new QGridLayout;
options_layout->addWidget(m_scaleOptions, 1, 0, 1, 2);
options_layout->addWidget(m_lblN, 2, 0);
options_layout->addWidget(m_dspnN, 2, 1);
......@@ -84,7 +84,7 @@ DraggableColorBarWidget::DraggableColorBarWidget(QWidget *parent,
options_layout->setRowStretch(1, 1);
options_layout->setRowStretch(2, 1);
QHBoxLayout *colourmap_layout = new QHBoxLayout;
auto *colourmap_layout = new QHBoxLayout;
colourmap_layout->addLayout(lColormapLayout);
colourmap_layout->addLayout(options_layout);
this->setLayout(colourmap_layout);
......
......@@ -118,7 +118,7 @@ MantidColorMap::~MantidColorMap() {}
* Create a clone of the color map
*/
QwtColorMap *MantidColorMap::copy() const {
MantidColorMap *map = new MantidColorMap;
auto *map = new MantidColorMap;
*map = *this;
return map;
......@@ -350,7 +350,7 @@ std::vector<QRgb> MantidColorMap::rgb(double vmin, double vmax,
*/
QRgb MantidColorMap::rgb(const QwtDoubleInterval &interval,
double value) const {
short ci = static_cast<short>(colorIndex(interval, value));
auto ci = static_cast<short>(colorIndex(interval, value));
if (ci >= 0 && ci < m_num_colors) {
return m_colors[ci];
}
......@@ -376,7 +376,7 @@ unsigned char MantidColorMap::colorIndex(const QwtDoubleInterval &interval,
if (fraction < 0.0)
return static_cast<unsigned char>(1);
short index = short(std::floor(fraction * m_num_colors));
auto index = short(std::floor(fraction * m_num_colors));
// If the ratio gives back 1 then we need to adjust the index down 1
if (index >= m_num_colors) {
index = short(m_num_colors - 1);
......
......@@ -78,7 +78,7 @@ PreviewPlot::PreviewPlot(QWidget *parent, bool init)
SLOT(handleViewToolSelect()));
// Create the reset plot view option
QAction *resetPlotAction = new QAction("Reset Plot", m_contextMenu);
auto *resetPlotAction = new QAction("Reset Plot", m_contextMenu);
connect(resetPlotAction, SIGNAL(triggered()), this, SLOT(resetView()));
m_contextMenu->addAction(resetPlotAction);
......@@ -312,7 +312,7 @@ void PreviewPlot::addSpectrum(const QString &curveName,
addCurve(m_curves[curveName], ws, wsIndex, curveColour, curveName);
// Create the curve label
QLabel *label = new QLabel(curveName);
auto *label = new QLabel(curveName);
label->setVisible(false);
QPalette palette = label->palette();
palette.setColor(label->foregroundRole(), curveColour);
......@@ -824,7 +824,7 @@ QList<QAction *> PreviewPlot::addOptionsToMenus(QString menuName,
QActionGroup *group,
QStringList items,
QString defaultItem) {
QMenu *menu = new QMenu(m_contextMenu);
auto *menu = new QMenu(m_contextMenu);
for (auto &item : items) {
QAction *action = new QAction(item, menu);
......@@ -838,7 +838,7 @@ QList<QAction *> PreviewPlot::addOptionsToMenus(QString menuName,
action->setChecked(item == defaultItem);
}
QAction *menuAction = new QAction(menuName, menu);
auto *menuAction = new QAction(menuName, menu);
menuAction->setMenu(menu);
// sets the name of the Y Axis menu so it can be accessed in the future
......
......@@ -39,7 +39,7 @@ QwtRasterDataMD::~QwtRasterDataMD() { delete[] m_slicePoint; }
//-------------------------------------------------------------------------
/** Perform a copy of this data object */
QwtRasterDataMD *QwtRasterDataMD::copy() const {
QwtRasterDataMD *out = new QwtRasterDataMD();
auto *out = new QwtRasterDataMD();
this->copyFrom(*this, *out);
return out;
}
......@@ -62,7 +62,7 @@ double QwtRasterDataMD::value(double x, double y) const {
return 0;
// Generate the vector of coordinates, filling in X and Y
coord_t *lookPoint = new coord_t[m_nd];
auto *lookPoint = new coord_t[m_nd];
for (size_t d = 0; d < m_nd; d++) {
if (d == m_dimX)
lookPoint[d] = static_cast<coord_t>(x);
......
......@@ -91,7 +91,7 @@ void QwtRasterDataMDNonOrthogonal::setSliceParams(
//-------------------------------------------------------------------------
/** Perform a copy of this data object */
QwtRasterDataMDNonOrthogonal *QwtRasterDataMDNonOrthogonal::copy() const {
QwtRasterDataMDNonOrthogonal *out = new QwtRasterDataMDNonOrthogonal();
auto *out = new QwtRasterDataMDNonOrthogonal();
this->copyFrom(*this, *out);
return out;
}
......
......@@ -57,8 +57,7 @@ public:
void test_copy() {
QwtWorkspaceBinData data1(*ws, 1, false);
QwtWorkspaceBinData *data2 =
dynamic_cast<QwtWorkspaceBinData *>(data1.copy());
auto *data2 = dynamic_cast<QwtWorkspaceBinData *>(data1.copy());
checkData(*data2, 1.0);
}
......
......@@ -58,8 +58,7 @@ public:
void test_copy() {
QwtWorkspaceSpectrumData data1(*ws, 1, false, false);
QwtWorkspaceSpectrumData *data2 =
dynamic_cast<QwtWorkspaceSpectrumData *>(data1.copy());
auto *data2 = dynamic_cast<QwtWorkspaceSpectrumData *>(data1.copy());
checkHistogramData(*data2, 1.0);
}
......
......@@ -37,8 +37,8 @@ LoadDAEDialog::LoadDAEDialog(QWidget *parent)
LoadDAEDialog::~LoadDAEDialog() {}
void LoadDAEDialog::initLayout() {
QGridLayout *paramsLayout = new QGridLayout;
QLabel *label = new QLabel(tr("DAE Name"));
auto *paramsLayout = new QGridLayout;
auto *label = new QLabel(tr("DAE Name"));
lineHost = new QLineEdit;
label->setBuddy(lineHost);
paramsLayout->addWidget(label, 0, 0);
......@@ -52,26 +52,26 @@ void LoadDAEDialog::initLayout() {
paramsLayout->addWidget(lineName, 1, 1);
tie(lineName, "OutputWorkspace", paramsLayout);
QLabel *minSpLabel = new QLabel("Starting spectrum");
auto *minSpLabel = new QLabel("Starting spectrum");
minSpLineEdit = new QLineEdit;
paramsLayout->addWidget(minSpLabel, 2, 0);
paramsLayout->addWidget(minSpLineEdit, 2, 1);
tie(minSpLineEdit, "SpectrumMin", paramsLayout);
QLabel *maxSpLabel = new QLabel("Ending spectrum");
auto *maxSpLabel = new QLabel("Ending spectrum");
maxSpLineEdit = new QLineEdit;
paramsLayout->addWidget(maxSpLabel, 3, 0);
paramsLayout->addWidget(maxSpLineEdit, 3, 1);
tie(maxSpLineEdit, "SpectrumMax", paramsLayout);
QLabel *listSpLabel = new QLabel("Spectrum List");
auto *listSpLabel = new QLabel("Spectrum List");
listSpLineEdit = new QLineEdit;
paramsLayout->addWidget(listSpLabel, 4, 0);
paramsLayout->addWidget(listSpLineEdit, 4, 1);
tie(listSpLineEdit, "SpectrumList", paramsLayout);
QHBoxLayout *updateLayout = new QHBoxLayout;
QLabel *updateLabel = new QLabel("Update every");
auto *updateLayout = new QHBoxLayout;
auto *updateLabel = new QLabel("Update every");
updateLineEdit = new QLineEdit;
QIntValidator *ival = new QIntValidator(1, 99999999, updateLineEdit);
updateLineEdit->setValidator(ival);
......@@ -83,7 +83,7 @@ void LoadDAEDialog::initLayout() {
paramsLayout->addLayout(updateLayout, 5, 1);
tie(updateLineEdit, "UpdateRate", updateLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto *mainLayout = new QVBoxLayout;
mainLayout->addLayout(paramsLayout);
mainLayout->addLayout(createDefaultButtonLayout("?", "Load", "Cancel"));
......
......@@ -339,8 +339,8 @@ int LoadDialog::createWidgetsForProperty(const Mantid::Kernel::Property *prop,
bool addValidator(true);
// Boolean properties use the name labels differently
if (const FileProperty *fileType = dynamic_cast<const FileProperty *>(prop)) {
MWRunFiles *fileFinder = new MWRunFiles(parent);
if (const auto *fileType = dynamic_cast<const FileProperty *>(prop)) {
auto *fileFinder = new MWRunFiles(parent);
inputWidget = fileFinder;
fileFinder->setLabelText(propName);
fileFinder->isForRunFiles(false);
......@@ -352,13 +352,13 @@ int LoadDialog::createWidgetsForProperty(const Mantid::Kernel::Property *prop,
QLabel *nameLbl = new QLabel(propName, parent);
nameLbl->setToolTip(QString::fromStdString(prop->briefDocumentation()));
if (dynamic_cast<const PropertyWithValue<bool> *>(prop)) {
QCheckBox *checkBox = new QCheckBox(parent);
auto *checkBox = new QCheckBox(parent);
inputWidget = checkBox;
addValidator = false;
}
// Options box
else if (!prop->allowedValues().empty()) {
QComboBox *optionsBox = new QComboBox(parent);
auto *optionsBox = new QComboBox(parent);
inputWidget = optionsBox;
std::vector<std::string> items = prop->allowedValues();
std::vector<std::string>::const_iterator vend = items.end();
......@@ -375,7 +375,7 @@ int LoadDialog::createWidgetsForProperty(const Mantid::Kernel::Property *prop,
}
// else render a text box
else {
QLineEdit *textBox = new QLineEdit(parent);
auto *textBox = new QLineEdit(parent);
inputWidget = textBox;
if (dynamic_cast<const MaskedProperty<std::string> *>(prop)) {
textBox->setEchoMode(QLineEdit::Password);
......
......@@ -60,7 +60,7 @@ void LoadRawDialog::initLayout() {
this->addOptionalMessage(main_layout);
//------------- Filename property ---------------------
QHBoxLayout *prop_line = new QHBoxLayout;
auto *prop_line = new QHBoxLayout;
prop_line->addWidget(new QLabel("Select a file to load:"));
m_pathBox = new QLineEdit;
......@@ -68,7 +68,7 @@ void LoadRawDialog::initLayout() {
prop_line->addWidget(m_pathBox);
tie(m_pathBox, "Filename", prop_line);
QPushButton *browseBtn = new QPushButton("Browse");
auto *browseBtn = new QPushButton("Browse");
connect(browseBtn, SIGNAL(clicked()), this, SLOT(browseClicked()));
browseBtn->setEnabled(isWidgetEnabled("Filename"));
prop_line->addWidget(browseBtn);
......@@ -86,10 +86,10 @@ void LoadRawDialog::initLayout() {
main_layout->addLayout(prop_line);
//------------- Spectra properties ---------------------
QGroupBox *groupbox = new QGroupBox("Spectra Options");
auto *groupbox = new QGroupBox("Spectra Options");
prop_line = new QHBoxLayout;
QLineEdit *text_field = new QLineEdit;
auto *text_field = new QLineEdit;
text_field->setMaximumWidth(m_wsBox->fontMetrics().width("888888"));
prop_line->addWidget(new QLabel("Start:"));
prop_line->addWidget(text_field);
......@@ -125,7 +125,7 @@ void LoadRawDialog::initLayout() {
Mantid::Kernel::Property *cacheProp = getAlgorithmProperty("Cache");
if (cacheProp) {
QComboBox *cacheBox = new QComboBox;
auto *cacheBox = new QComboBox;
std::vector<std::string> items = cacheProp->allowedValues();
std::vector<std::string>::const_iterator vend = items.end();
for (std::vector<std::string>::const_iterator vitr = items.begin();
......@@ -152,7 +152,7 @@ void LoadRawDialog::initLayout() {
// add a check box for it ----
Mantid::Kernel::Property *loadMonitors = getAlgorithmProperty("LoadMonitors");
if (loadMonitors) {
QComboBox *monitorsBox = new QComboBox;
auto *monitorsBox = new QComboBox;
std::vector<std::string> monitoritems = loadMonitors->allowedValues();
std::vector<std::string>::const_iterator mend = monitoritems.end();
for (std::vector<std::string>::const_iterator mitr = monitoritems.begin();
......
......@@ -22,7 +22,7 @@ using namespace MantidQt::CustomDialogs;
//--------------------------------------------------------//
PointGroupBox::PointGroupBox(QWidget *parent) : QGroupBox(parent), m_icoord(0) {
QGridLayout *grid = new QGridLayout;
auto *grid = new QGridLayout;
// The line edit fields
m_midx = new QLineEdit;
......@@ -177,7 +177,7 @@ QString Operation::toString(QString left, QString right) const {
* Create a QComboBox filled with length units (static)
*/
QComboBox *ShapeDetails::createLengthUnitsCombo() {
QComboBox *units = new QComboBox;
auto *units = new QComboBox;
QStringList unit_labels("mm");
unit_labels << "cm"
<< "m";
......@@ -229,11 +229,11 @@ SphereDetails::SphereDetails(QWidget *parent) : ShapeDetails(parent) {
++g_nspheres;
m_idvalue = "sphere_" + QString::number(g_nspheres);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// radius
m_radius_box = new QLineEdit;
m_runits = createLengthUnitsCombo();
QHBoxLayout *rad_layout = new QHBoxLayout;
auto *rad_layout = new QHBoxLayout;
rad_layout->addWidget(new QLabel("Radius: "));
rad_layout->addWidget(m_radius_box);
rad_layout->addWidget(m_runits);
......@@ -274,11 +274,11 @@ CylinderDetails::CylinderDetails(QWidget *parent) : ShapeDetails(parent) {
++g_ncylinders;
m_idvalue = "cylinder_" + QString::number(g_ncylinders);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// radius
m_radius_box = new QLineEdit;
m_runits = createLengthUnitsCombo();
QHBoxLayout *rad_layout = new QHBoxLayout;
auto *rad_layout = new QHBoxLayout;
rad_layout->addWidget(new QLabel("Radius: "));
rad_layout->addWidget(m_radius_box);
rad_layout->addWidget(m_runits);
......@@ -286,7 +286,7 @@ CylinderDetails::CylinderDetails(QWidget *parent) : ShapeDetails(parent) {
// height
m_height_box = new QLineEdit;
m_hunits = createLengthUnitsCombo();
QHBoxLayout *hgt_layout = new QHBoxLayout;
auto *hgt_layout = new QHBoxLayout;
hgt_layout->addWidget(new QLabel("Height: "));
hgt_layout->addWidget(m_height_box);
hgt_layout->addWidget(m_hunits);
......@@ -342,11 +342,11 @@ InfiniteCylinderDetails::InfiniteCylinderDetails(QWidget *parent)
++g_ninfcyls;
m_idvalue = "infcyl_" + QString::number(g_ninfcyls);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// radius
m_radius_box = new QLineEdit;
m_runits = createLengthUnitsCombo();
QHBoxLayout *rad_layout = new QHBoxLayout;
auto *rad_layout = new QHBoxLayout;
rad_layout->addWidget(new QLabel("Radius: "));
rad_layout->addWidget(m_radius_box);
rad_layout->addWidget(m_runits);
......@@ -393,32 +393,32 @@ SliceOfCylinderRingDetails::SliceOfCylinderRingDetails(QWidget *parent)
++g_ncylrings;
m_idvalue = "cylslice_" + QString::number(g_ncylrings);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// inner radius
m_rinner_box = new QLineEdit;
m_iunits = createLengthUnitsCombo();
QHBoxLayout *rad_layout = new QHBoxLayout;
auto *rad_layout = new QHBoxLayout;
rad_layout->addWidget(new QLabel("Inner radius: "));
rad_layout->addWidget(m_rinner_box);
rad_layout->addWidget(m_iunits);
// Outer
m_router_box = new QLineEdit;
m_ounits = createLengthUnitsCombo();
QHBoxLayout *rad2_layout = new QHBoxLayout;
auto *rad2_layout = new QHBoxLayout;
rad2_layout->addWidget(new QLabel("Outer radius: "));
rad2_layout->addWidget(m_router_box);
rad2_layout->addWidget(m_ounits);
// Depth
m_depth_box = new QLineEdit;
m_dunits = createLengthUnitsCombo();
QHBoxLayout *dep_layout = new QHBoxLayout;
auto *dep_layout = new QHBoxLayout;
dep_layout->addWidget(new QLabel(" Depth: "));
dep_layout->addWidget(m_depth_box);
dep_layout->addWidget(m_dunits);
// Arc
m_arc_box = new QLineEdit;
QHBoxLayout *arc_layout = new QHBoxLayout;
auto *arc_layout = new QHBoxLayout;
arc_layout->addWidget(new QLabel("Arc: "));
arc_layout->addWidget(m_arc_box);
arc_layout->addWidget(new QLabel(" deg "));
......@@ -481,18 +481,18 @@ ConeDetails::ConeDetails(QWidget *parent) : ShapeDetails(parent) {
++g_ncones;
m_idvalue = "cone_" + QString::number(g_ncones);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// Height
m_height_box = new QLineEdit;
m_hunits = createLengthUnitsCombo();
QHBoxLayout *hgt_layout = new QHBoxLayout;
auto *hgt_layout = new QHBoxLayout;
hgt_layout->addWidget(new QLabel("Height: "));
hgt_layout->addWidget(m_height_box);
hgt_layout->addWidget(m_hunits);
// Angle
m_angle_box = new QLineEdit;
QHBoxLayout *ang_layout = new QHBoxLayout;
auto *ang_layout = new QHBoxLayout;
ang_layout->addWidget(new QLabel("Angle: "));
ang_layout->addWidget(m_angle_box);
ang_layout->addWidget(new QLabel(" deg "));
......@@ -548,10 +548,10 @@ InfiniteConeDetails::InfiniteConeDetails(QWidget *parent)
++g_ninfcones;
m_idvalue = "infcone_" + QString::number(g_ninfcones);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// Angle
m_angle_box = new QLineEdit;
QHBoxLayout *ang_layout = new QHBoxLayout;
auto *ang_layout = new QHBoxLayout;
ang_layout->addWidget(new QLabel("Angle: "));
ang_layout->addWidget(m_angle_box);
ang_layout->addWidget(new QLabel(" deg "));
......@@ -599,7 +599,7 @@ InfinitePlaneDetails::InfinitePlaneDetails(QWidget *parent)
++g_ninfplanes;
m_idvalue = "infplane_" + QString::number(g_ninfplanes);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// Point boxes
m_plane = new PointGroupBox;
......@@ -636,7 +636,7 @@ CuboidDetails::CuboidDetails(QWidget *parent) : ShapeDetails(parent) {
++g_ncuboids;
m_idvalue = "cuboid_" + QString::number(g_ncuboids);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// Point boxes
m_left_frt_bot = new PointGroupBox;
......@@ -682,7 +682,7 @@ HexahedronDetails::HexahedronDetails(QWidget *parent) : ShapeDetails(parent) {
++g_nhexahedrons;
m_idvalue = "hexahedron_" + QString::number(g_nhexahedrons);
QVBoxLayout *main_layout = new QVBoxLayout(this);
auto *main_layout = new QVBoxLayout(this);
// Point boxes
m_left_bck_bot = new PointGroupBox;
......
......@@ -175,12 +175,12 @@ void SortTableWorkspaceDialog::addColumn() {
auto newRow = m_sortColumns.size();
assert(newRow <= m_columnNames.size());
QLabel *label = new QLabel(QString("Column %1").arg(newRow + 1));
QComboBox *columnName = new QComboBox();
auto *columnName = new QComboBox();
columnName->addItems(m_columnNames);
columnName->setToolTip(m_form.cbColumnName->toolTip());
connect(columnName, SIGNAL(currentIndexChanged(int)), this,
SLOT(changedColumnName(int)));
QComboBox *ascending = new QComboBox();
auto *ascending = new QComboBox();
ascending->addItem("Ascending");
ascending->addItem("Descending");
ascending->setToolTip(m_form.cbAscending->toolTip());
......
......@@ -386,9 +386,9 @@ void RefIVConnections::vGraphPickerMoved() {
}
void RefIVConnections::intensitySliderMoved() {
double value = (double)m_ivUI->intensity_slider->value();
double min = (double)m_ivUI->intensity_slider->minimum();
double max = (double)m_ivUI->intensity_slider->maximum();
auto value = (double)m_ivUI->intensity_slider->value();
auto min = (double)m_ivUI->intensity_slider->minimum();
auto max = (double)m_ivUI->intensity_slider->maximum();
double scaledValue = 100.0 * (value - min) / (max - min);
m_imageDisplay->setIntensity(scaledValue);
......
......@@ -66,7 +66,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
painter->setPen(Qt::blue);
// peak1
float peakLeft = float(m_limitsHandler->getPeakLeft());
auto peakLeft = float(m_limitsHandler->getPeakLeft());
if (peakLeft != 0) {
coeff_top_right = float(y_max) - float(peakLeft);
......@@ -76,7 +76,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
}
// peak2
float peakRight = float(m_limitsHandler->getPeakRight());
auto peakRight = float(m_limitsHandler->getPeakRight());
if (peakRight != 0) {
coeff_top_right = float(y_max) - float(peakRight);
pixel_value = int((coeff_top_right / coeff_left) + float(pix_y_max));
......@@ -88,7 +88,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
painter->setPen(Qt::red);
// back1
float backLeft = float(m_limitsHandler->getBackLeft());
auto backLeft = float(m_limitsHandler->getBackLeft());
if (backLeft != 0) {
coeff_top_right = float(y_max) - float(backLeft);
pixel_value = int((coeff_top_right / coeff_left) + float(pix_y_max));
......@@ -97,7 +97,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
}
// back2
float backRight = float(m_limitsHandler->getBackRight());
auto backRight = float(m_limitsHandler->getBackRight());
if (backRight != 0) {
coeff_top_right = float(y_max) - float(backRight);
pixel_value = int((coeff_top_right / coeff_left) + float(pix_y_max));
......@@ -114,7 +114,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
float coeff_bottom_right;
// tof min
float TOFmin = float(m_limitsHandler->getTOFmin());
auto TOFmin = float(m_limitsHandler->getTOFmin());
if (TOFmin != 0) {
coeff_bottom_right = float(TOFmin) - float(x_min);
tof_value =
......@@ -124,7 +124,7 @@ void RefImagePlotItem::draw(QPainter *painter, const QwtScaleMap &xMap,
}
// tof max
float TOFmax = float(m_limitsHandler->getTOFmax());
auto TOFmax = float(m_limitsHandler->getTOFmax());
if (TOFmax != 0) {
coeff_bottom_right = float(TOFmax) - float(x_min);
tof_value = int(coeff_left * coeff_bottom_right + float(pix_x_min));
......
......@@ -56,7 +56,7 @@ RefImageView::RefImageView(SpectrumView::SpectrumDataSource_sptr dataSource,
// Create the handler for comminicating peak/background/tof values to/from the
// ui
// This ends up being owned by the RefImagePlotItem instance
RefLimitsHandler *limits_handler = new RefLimitsHandler(m_ui);
auto *limits_handler = new RefLimitsHandler(m_ui);
m_hGraph = new SpectrumView::GraphDisplay(m_ui->h_graphPlot, nullptr, false);
m_vGraph = new SpectrumView::GraphDisplay(m_ui->v_graphPlot, nullptr, true);
......@@ -65,7 +65,7 @@ RefImageView::RefImageView(SpectrumView::SpectrumDataSource_sptr dataSource,
m_rangeHandler, limits_handler, m_hGraph,
m_vGraph, m_ui->image_table);
RefIVConnections *iv_connections =
auto *iv_connections =
new RefIVConnections(m_ui, this, m_imageDisplay, m_hGraph, m_vGraph);
// Set validators on the QLineEdits to restrict them to integers
......
......@@ -37,7 +37,7 @@ private:
ColourMapType m_foregroundMap;
typename ColourMapType::iterator safeFetchPair(ColourMapType &map,
const int index) {
typename ColourMapType::iterator it = map.find(index);
auto it = map.find(index);