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

Re #25299 qt modernize-use-auto

parent aaf83ba1
......@@ -106,7 +106,7 @@ void WorkspaceTreeWidget::setupWidgetLayout() {
m_tree = new MantidTreeWidget(m_mantidDisplayModel, this);
m_tree->setHeaderLabel("Workspaces");
FlowLayout *buttonLayout = new FlowLayout();
auto *buttonLayout = new FlowLayout();
m_loadButton = new QPushButton("Load");
m_saveButton = new QPushButton("Save");
m_deleteButton = new QPushButton("Delete");
......@@ -128,7 +128,7 @@ void WorkspaceTreeWidget::setupWidgetLayout() {
m_workspaceFilter->setPlaceholderText("Filter Workspaces");
m_workspaceFilter->setToolTip("Type here to filter the workspaces");
QVBoxLayout *layout = new QVBoxLayout();
auto *layout = new QVBoxLayout();
layout->setSpacing(0);
layout->setMargin(0);
layout->addLayout(buttonLayout);
......@@ -240,8 +240,7 @@ void WorkspaceTreeWidget::showCriticalUserMessage(
void WorkspaceTreeWidget::onLoadAccept() {
QObject *sender = QObject::sender();
MantidQt::API::AlgorithmDialog *dlg =
reinterpret_cast<MantidQt::API::AlgorithmDialog *>(sender);
auto *dlg = reinterpret_cast<MantidQt::API::AlgorithmDialog *>(sender);
if (!dlg)
return; // should never happen
......@@ -867,8 +866,7 @@ MantidTreeWidgetItem *WorkspaceTreeWidget::addTreeEntry(
// A a child ID item so that it becomes expandable. Using the correct ID is
// needed when plotting from non-expanded groups.
const std::string wsID = item.second->id();
MantidTreeWidgetItem *idNode =
new MantidTreeWidgetItem(QStringList(wsID.c_str()), m_tree);
auto *idNode = new MantidTreeWidgetItem(QStringList(wsID.c_str()), m_tree);
idNode->setFlags(Qt::NoItemFlags);
node->addChild(idNode);
setItemIcon(node, wsID);
......@@ -1424,7 +1422,7 @@ void WorkspaceTreeWidget::saveToProgram() {
// Get the file extention based on the workspace
Property *prop = alg->getProperty("Filename");
FileProperty *fileProp = dynamic_cast<FileProperty *>(prop);
auto *fileProp = dynamic_cast<FileProperty *>(prop);
std::string ext;
if (fileProp) {
ext = fileProp->getDefaultExt();
......
......@@ -238,9 +238,9 @@ pqHelpWindow::pqHelpWindow(QHelpEngine *engine, QWidget *parentObject,
SIGNAL(helpWarnings(const QString &)));
// add a navigation toolbar
QToolBar *navigation = new QToolBar("Navigation");
QPushButton *home = new QPushButton("Home");
QPushButton *print = new QPushButton("Print...");
auto *navigation = new QToolBar("Navigation");
auto *home = new QPushButton("Home");
auto *print = new QPushButton("Print...");
print->setToolTip("Print the current page");
m_forward = new QToolButton();
......@@ -269,8 +269,8 @@ pqHelpWindow::pqHelpWindow(QHelpEngine *engine, QWidget *parentObject,
ui.indexDock->setWidget(this->m_helpEngine->indexWidget());
// setup the search tab
QWidget *searchPane = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
auto *searchPane = new QWidget(this);
auto *vbox = new QVBoxLayout();
searchPane->setLayout(vbox);
vbox->addWidget(this->m_helpEngine->searchEngine()->queryWidget());
vbox->addWidget(this->m_helpEngine->searchEngine()->resultWidget());
......@@ -292,8 +292,7 @@ pqHelpWindow::pqHelpWindow(QHelpEngine *engine, QWidget *parentObject,
#if defined(USE_QTWEBKIT)
m_browser = new QWebView(this);
QNetworkAccessManager *oldManager = m_browser->page()->networkAccessManager();
pqNetworkAccessManager *newManager =
new pqNetworkAccessManager(m_helpEngine, oldManager, this);
auto *newManager = new pqNetworkAccessManager(m_helpEngine, oldManager, this);
m_browser->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
m_browser->page()->setNetworkAccessManager(newManager);
m_browser->page()->setForwardUnsupportedContent(false);
......
......@@ -33,7 +33,7 @@ public:
void test_find_single_file() {
// Arrange
FakeMWRunFiles *widget = new FakeMWRunFiles();
auto *widget = new FakeMWRunFiles();
// The parameters of the search
FindFilesSearchParameters parameters;
......
......@@ -48,7 +48,7 @@ public:
void test_create_instance() {
// fake repo contains the files Repo/README.txt, Repo/TofConverter.py,
// Repo/reflectometry/Reduction.py and Repo/reflectometry/script.py
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
// contains TofConv and reflectometry folders
TS_ASSERT_EQUALS(1, model->rowCount());
TS_ASSERT_EQUALS(4, model->columnCount());
......@@ -63,7 +63,7 @@ public:
// test the data in the first column is displayed correctly. This column
// contains the name of the file
void test_data_first_column_entries() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
int role = Qt::DisplayRole;
std::string expectedEntries[6] = {
"Repo", "README.txt", "TofConverter.py",
......@@ -78,7 +78,7 @@ public:
// test the data in the second column is displayed correctly. This column
// contains the status of the file
void test_data_second_column_entries() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
int role = Qt::DisplayRole;
std::string expectedEntries[6] = {"LOCAL_ONLY", "UPDATED",
"REMOTE_ONLY", "CHANGED",
......@@ -93,7 +93,7 @@ public:
// test the data in the first column is displayed correctly. This column
// contains whether the file is set to update.
void test_data_third_column_entries() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
int role = Qt::DisplayRole;
auto filenames = scriptRepoMock.listFiles();
// expect empty string for local only and remote only as not applicable
......@@ -108,7 +108,7 @@ public:
// test the data in the fourth column is displayed correctly. This column
// contains whether the file can be deleted.
void test_data_fourth_column_entries() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
int role = Qt::DisplayRole;
auto filenames = scriptRepoMock.listFiles();
std::string expectedEntries[6] = {"protected", "deletable", "protected",
......@@ -122,7 +122,7 @@ public:
// test setData will download file if download selected
void test_setData_sets_download() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
auto index = getIndex(model, 1, 1);
auto isDataSet = model->setData(index, "Download", Qt::EditRole);
TS_ASSERT_EQUALS(true, isDataSet);
......@@ -143,7 +143,7 @@ public:
// test setData will not change the data if the index is out of range
void test_setData_index_out_of_range() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
QModelIndex index = model->index(10, 10);
QString value = "";
int role = Qt::EditRole;
......@@ -152,7 +152,7 @@ public:
// test setData will not change the data if the role is not Qt::EditRole
void test_setData_not_editable() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
auto index = getIndex(model, 1, 1);
QString value = "";
int role = Qt::DisplayRole;
......@@ -162,7 +162,7 @@ public:
// test setData will not change the data in the first column - the path of the
// file
void test_setData_column_0_should_not_change() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
auto index = getIndex(model, 1, 0);
QString value = "";
int role = Qt::EditRole;
......@@ -170,7 +170,7 @@ public:
}
void test_file_description_gives_file_path() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
auto filenames = scriptRepoMock.listFiles();
for (auto i = 0; i < 6; ++i) {
for (auto j = 0; j < model->columnCount(); ++j) {
......@@ -182,7 +182,7 @@ public:
}
void test_author_returns_correct_author() {
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
for (auto i = 0; i < 6; ++i) {
for (auto j = 0; j < model->columnCount(); ++j) {
auto index = getIndex(model, i, j);
......@@ -195,7 +195,7 @@ public:
void test_filepath_returns_correct_path() {
auto repo_path = Mantid::Kernel::ConfigService::Instance().getString(
"ScriptLocalRepository");
RepoModel *model = new RepoModel();
auto *model = new RepoModel();
auto filenames = scriptRepoMock.listFiles();
for (auto i = 0; i < 6; ++i) {
std::string expectedPath = "";
......
......@@ -21,7 +21,7 @@ public:
static void destroySuite(SignalBlockerTest *suite) { delete suite; }
void test_obtain_and_release_behaviour() {
QObject *toBlock = new QObject;
auto *toBlock = new QObject;
{
SignalBlocker scopedObj(toBlock);
TSM_ASSERT("Should now block", toBlock->signalsBlocked());
......
......@@ -127,8 +127,7 @@ void WidgetFactory::closeSliceViewerWindow(SliceViewerWindow *w) {
*/
MantidQt::SliceViewer::SliceViewer *
WidgetFactory::createSliceViewer(const QString &wsName) {
MantidQt::SliceViewer::SliceViewer *slicer =
new MantidQt::SliceViewer::SliceViewer();
auto *slicer = new MantidQt::SliceViewer::SliceViewer();
// TODO: Save in a list ?
if (!wsName.isEmpty())
slicer->setWorkspace(wsName);
......
......@@ -62,14 +62,14 @@ QWidget *BaseCustomInstrumentView::generateLoadWidget() {
void BaseCustomInstrumentView::setupInstrumentAnalysisSplitters(
QWidget *analysisPane) {
QSplitter *split = new QSplitter(Qt::Horizontal);
auto *split = new QSplitter(Qt::Horizontal);
split->addWidget(m_instrumentWidget);
split->addWidget(analysisPane);
this->addWidget(split);
}
void BaseCustomInstrumentView::setupHelp() {
QWidget *helpWidget = new QWidget();
auto *helpWidget = new QWidget();
m_help = new QPushButton("?");
m_help->setMaximumWidth(25);
auto helpLayout = new QHBoxLayout(helpWidget);
......
......@@ -26,7 +26,7 @@ BinDialog::BinDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(QString("Select X Range"));
// frame for group box
QFrame *groupBox = new QFrame();
auto *groupBox = new QFrame();
// Double Validator
QValidator *validator = new QDoubleValidator(this);
// Input value for Integral option
......@@ -41,7 +41,7 @@ BinDialog::BinDialog(QWidget *parent) : QDialog(parent) {
SLOT(mEntireRange_toggled(bool)));
// Create a grid layout
QGridLayout *gridbox = new QGridLayout;
auto *gridbox = new QGridLayout;
gridbox->addWidget(new QLabel("Min X Value:"), 0, 0);
gridbox->addWidget(mIntegralMinValue, 0, 1);
gridbox->addWidget(new QLabel("Max X Value:"), 1, 0);
......@@ -50,14 +50,14 @@ BinDialog::BinDialog(QWidget *parent) : QDialog(parent) {
groupBox->setLayout(gridbox);
// create a frame for Ok and Cancel btn
QFrame *okcancelFrame = new QFrame();
QPushButton *okButton = new QPushButton("Ok");
QPushButton *cancelButton = new QPushButton("Cancel");
QHBoxLayout *okcancelLayout = new QHBoxLayout;
auto *okcancelFrame = new QFrame();
auto *okButton = new QPushButton("Ok");
auto *cancelButton = new QPushButton("Cancel");
auto *okcancelLayout = new QHBoxLayout;
okcancelLayout->addWidget(okButton);
okcancelLayout->addWidget(cancelButton);
okcancelFrame->setLayout(okcancelLayout);
QVBoxLayout *dialogLayout = new QVBoxLayout();
auto *dialogLayout = new QVBoxLayout();
dialogLayout->addWidget(groupBox);
dialogLayout->addWidget(okcancelFrame);
this->setLayout(dialogLayout);
......
......@@ -120,7 +120,7 @@ CollapsibleStack::CollapsibleStack(QWidget *parent) : QWidget(parent) {
*/
CollapsiblePanel *CollapsibleStack::addPanel(const QString &caption,
QWidget *widget) {
CollapsiblePanel *panel = new CollapsiblePanel(caption, this);
auto *panel = new CollapsiblePanel(caption, this);
panel->setWidget(widget);
m_layout->addWidget(panel);
connect(panel, SIGNAL(collapsed()), this, SLOT(updateStretch()));
......@@ -131,7 +131,7 @@ CollapsiblePanel *CollapsibleStack::addPanel(const QString &caption,
bool CollapsibleStack::allCollapsed() const {
int n = m_layout->count();
for (int i = 0; i < n; ++i) {
CollapsiblePanel *panel =
auto *panel =
dynamic_cast<CollapsiblePanel *>(m_layout->itemAt(i)->widget());
if (panel && !panel->isCollapsed()) {
return false;
......@@ -145,8 +145,7 @@ void CollapsibleStack::updateStretch() {
if (i == 0)
return;
--i; // point to the last item
CollapsiblePanel *panel =
dynamic_cast<CollapsiblePanel *>(m_layout->itemAt(i)->widget());
auto *panel = dynamic_cast<CollapsiblePanel *>(m_layout->itemAt(i)->widget());
if (allCollapsed()) { // make sure that the last item is a stretch
if (panel) // if it's a panel there is no stretch
{
......
......@@ -28,7 +28,7 @@ DetXMLFile::DetXMLFile(const std::vector<int> &detector_list,
std::ofstream out(m_fileName.toStdString().c_str());
out << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \n<detector-grouping> \n";
out << R"(<group name="sum"> <detids val=")";
std::vector<int>::const_iterator idet = detector_list.begin();
auto idet = detector_list.begin();
for (; idet != detector_list.end(); ++idet) {
if (!exclude.contains(*idet)) {
out << *idet << ',';
......
......@@ -125,7 +125,7 @@ InstrumentWidget::InstrumentWidget(const QString &wsName, QWidget *parent,
m_wsReplace(false), m_help(nullptr) {
setFocusPolicy(Qt::StrongFocus);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QSplitter *controlPanelLayout = new QSplitter(Qt::Horizontal);
auto *controlPanelLayout = new QSplitter(Qt::Horizontal);
// Add Tab control panel
mControlsTab = new QTabWidget(this);
......@@ -158,7 +158,7 @@ InstrumentWidget::InstrumentWidget(const QString &wsName, QWidget *parent,
SLOT(setIntegrationRange(double, double)));
// Set the mouse/keyboard operation info and help button
QHBoxLayout *infoLayout = new QHBoxLayout();
auto *infoLayout = new QHBoxLayout();
mInteractionInfo = new QLabel();
infoLayout->addWidget(mInteractionInfo);
m_help = new QPushButton("?");
......@@ -419,7 +419,7 @@ void InstrumentWidget::setSurfaceType(int type) {
if (type < RENDERMODE_SIZE) {
QApplication::setOverrideCursor(Qt::WaitCursor);
SurfaceType surfaceType = SurfaceType(type);
auto surfaceType = SurfaceType(type);
if (!m_instrumentActor)
return;
......@@ -1132,8 +1132,7 @@ void InstrumentWidget::setSurface(ProjectionSurface *surface) {
m_simpleDisplay->setSurface(sharedSurface);
m_simpleDisplay->update();
}
UnwrappedSurface *unwrappedSurface =
dynamic_cast<UnwrappedSurface *>(surface);
auto *unwrappedSurface = dynamic_cast<UnwrappedSurface *>(surface);
if (unwrappedSurface) {
m_renderTab->flipUnwrappedView(unwrappedSurface->isFlippedView());
}
......
......@@ -135,7 +135,7 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
m_free_draw->setToolTip("Draw an arbitrary shape (Shift+Alt+A)");
m_free_draw->setShortcut(QKeySequence("Shift+Alt+A"));
QHBoxLayout *toolBox = new QHBoxLayout();
auto *toolBox = new QHBoxLayout();
toolBox->addWidget(m_move);
toolBox->addWidget(m_pointer);
toolBox->addWidget(m_ellipse);
......@@ -155,7 +155,7 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
connect(m_ring_rectangle, SIGNAL(clicked()), this, SLOT(setActivity()));
connect(m_free_draw, SIGNAL(clicked()), this, SLOT(setActivity()));
m_move->setChecked(true);
QFrame *toolGroup = new QFrame();
auto *toolGroup = new QFrame();
toolGroup->setLayout(toolBox);
layout->addWidget(toolGroup);
......@@ -168,12 +168,12 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
connect(m_masking_on, SIGNAL(clicked()), this, SLOT(toggleMaskGroup()));
connect(m_grouping_on, SIGNAL(clicked()), this, SLOT(toggleMaskGroup()));
connect(m_roi_on, SIGNAL(clicked()), this, SLOT(toggleMaskGroup()));
QHBoxLayout *radioLayout = new QHBoxLayout();
auto *radioLayout = new QHBoxLayout();
radioLayout->addWidget(m_masking_on);
radioLayout->addWidget(m_roi_on);
radioLayout->addWidget(m_grouping_on);
radioLayout->setMargin(0);
QGroupBox *radioGroup = new QGroupBox();
auto *radioGroup = new QGroupBox();
radioGroup->setStyleSheet("border: none;");
radioGroup->setLayout(radioLayout);
......@@ -325,8 +325,8 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
connect(m_saveROI, SIGNAL(hovered(QAction *)), this,
SLOT(showSaveMenuTooltip(QAction *)));
QGroupBox *box = new QGroupBox("View");
QGridLayout *buttons = new QGridLayout();
auto *box = new QGroupBox("View");
auto *buttons = new QGridLayout();
buttons->addWidget(m_applyToView, 0, 0, 1, 2);
buttons->addWidget(m_saveShapesToTable, 1, 0, 1, 2);
buttons->addWidget(m_saveButton, 2, 0);
......
......@@ -250,7 +250,7 @@ InstrumentWidgetPickTab::InstrumentWidgetPickTab(InstrumentWidget *instrWidget)
m_peakAlign->setIcon(QIcon(":/PickTools/selection-peak-plane.png"));
m_peakAlign->setToolTip("Crystal peak alignment tool");
QGridLayout *toolBox = new QGridLayout();
auto *toolBox = new QGridLayout();
toolBox->addWidget(m_zoom, 0, 0);
toolBox->addWidget(m_edit, 0, 1);
toolBox->addWidget(m_ellipse, 0, 2);
......@@ -589,7 +589,7 @@ void InstrumentWidgetPickTab::initSurface() {
SLOT(updatePlotMultipleDetectors()));
connect(surface, SIGNAL(shapesRemoved()), this,
SLOT(updatePlotMultipleDetectors()));
Projection3D *p3d = dynamic_cast<Projection3D *>(surface);
auto *p3d = dynamic_cast<Projection3D *>(surface);
if (p3d) {
connect(p3d, SIGNAL(finishedMove()), this,
SLOT(updatePlotMultipleDetectors()));
......
......@@ -63,7 +63,7 @@ InstrumentWidgetRenderTab::InstrumentWidgetRenderTab(
setupColorMapWidget();
QHBoxLayout *unwrappedControlsLayout = new QHBoxLayout;
auto *unwrappedControlsLayout = new QHBoxLayout;
setupUnwrappedControls(unwrappedControlsLayout);
m_autoscaling = new QCheckBox("Autoscaling", this);
......@@ -289,7 +289,7 @@ void InstrumentWidgetRenderTab::setupGridBankMenu(QVBoxLayout *parentLayout) {
SLOT(setVisibleLayer(int)));
connect(m_layerSlide, SIGNAL(valueChanged(int)), m_layerDisplay,
SLOT(setNum(int)));
QHBoxLayout *voxelControlsLayout = new QHBoxLayout();
auto *voxelControlsLayout = new QHBoxLayout();
voxelControlsLayout->addWidget(m_layerCheck);
voxelControlsLayout->addWidget(m_layerSlide);
voxelControlsLayout->addWidget(m_layerDisplay);
......@@ -305,7 +305,7 @@ void InstrumentWidgetRenderTab::setupGridBankMenu(QVBoxLayout *parentLayout) {
*/
QFrame *InstrumentWidgetRenderTab::setupAxisFrame() {
m_resetViewFrame = new QFrame();
QHBoxLayout *axisViewLayout = new QHBoxLayout();
auto *axisViewLayout = new QHBoxLayout();
axisViewLayout->addWidget(new QLabel("Axis View:"));
mAxisCombo = new QComboBox();
......@@ -672,7 +672,7 @@ QMenu *InstrumentWidgetRenderTab::createPeaksMenu() {
m_precisionActionGroup = new QActionGroup(this);
QSignalMapper *signalMapper = new QSignalMapper(this);
for (int i = 1; i < 10; ++i) {
QAction *prec = new QAction(QString::number(i), setPrecision);
auto *prec = new QAction(QString::number(i), setPrecision);
prec->setCheckable(true);
setPrecision->addAction(prec);
connect(prec, SIGNAL(triggered()), signalMapper, SLOT(map()));
......
......@@ -21,7 +21,7 @@ namespace MantidWidgets {
InstrumentWidgetTreeTab::InstrumentWidgetTreeTab(InstrumentWidget *instrWidget)
: InstrumentWidgetTab(instrWidget) {
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
// Tree Controls
m_instrumentTree = new InstrumentTreeWidget(nullptr);
layout->addWidget(m_instrumentTree);
......
......@@ -368,7 +368,7 @@ void MiniPlotQwt::setYLogScale() {
const QwtScaleDiv *div = axisScaleDiv(QwtPlot::yLeft);
double from = div->lBound();
double to = div->hBound();
QwtLog10ScaleEngine *logEngine = new QwtLog10ScaleEngine();
auto *logEngine = new QwtLog10ScaleEngine();
setAxisScaleEngine(yLeft, logEngine);
setYScale(from, to);
recalcYAxisDivs();
......@@ -379,7 +379,7 @@ void MiniPlotQwt::setYLogScale() {
* Set the linear scale on the y axis
*/
void MiniPlotQwt::setYLinearScale() {
QwtLinearScaleEngine *engine = new QwtLinearScaleEngine();
auto *engine = new QwtLinearScaleEngine();
setAxisScaleEngine(yLeft, engine);
replot();
}
......@@ -389,7 +389,7 @@ void MiniPlotQwt::setYLinearScale() {
* @param marker :: A pointer to a PeakLabel, becomes owned by MiniPlotQwt
*/
void MiniPlotQwt::addPeakLabel(const PeakMarker2D *marker) {
PeakLabel *label = new PeakLabel(marker, this);
auto *label = new PeakLabel(marker, this);
label->attach(this);
m_peakLabels.append(label);
}
......
......@@ -297,7 +297,7 @@ void PanelsSurface::addFlatBankOfDetectors(
const Mantid::Kernel::V3D &normal, const std::vector<size_t> &detectors) {
int index = m_flatBanks.size();
// save bank info
FlatBankInfo *info = new FlatBankInfo(this);
auto *info = new FlatBankInfo(this);
m_flatBanks << info;
// record the first detector index of the bank
info->startDetectorIndex = detectors.front();
......@@ -332,7 +332,7 @@ void PanelsSurface::processStructured(size_t rootIndex) {
auto corners = retrievePanelCorners(componentInfo, rootIndex);
auto normal = calculatePanelNormal(corners);
// save bank info
FlatBankInfo *info = new FlatBankInfo(this);
auto *info = new FlatBankInfo(this);
m_flatBanks << info;
auto ref = corners[0];
// find the rotation to put the bank on the plane
......@@ -431,7 +431,7 @@ boost::optional<size_t> PanelsSurface::processTubes(size_t rootIndex) {
// save bank info
auto index = m_flatBanks.size();
FlatBankInfo *info = new FlatBankInfo(this);
auto *info = new FlatBankInfo(this);
m_flatBanks << info;
// record the first detector index of the bank
info->startDetectorIndex = componentInfo.children(tubes.front()).front();
......
......@@ -60,16 +60,16 @@ QWidget *PlotFitAnalysisPaneView::createFitPane(const double &start,
m_fitBrowser = new MantidWidgets::FunctionBrowser(this);
fitPaneLayout->addWidget(m_fitBrowser);
QLabel *startText = new QLabel("Fit from:");
auto *startText = new QLabel("Fit from:");
m_start = new QLineEdit(QString::number(start));
auto startValidator = new QDoubleValidator(m_start);
auto endValidator = new QDoubleValidator(m_start);
m_start->setValidator(startValidator);
QLabel *endText = new QLabel("to:");
auto *endText = new QLabel("to:");
m_end = new QLineEdit(QString::number(end));
m_end->setValidator(endValidator);
QWidget *range = new QWidget();
QHBoxLayout *rangeLayout = new QHBoxLayout(range);
auto *range = new QWidget();
auto *rangeLayout = new QHBoxLayout(range);
rangeLayout->addWidget(startText);
rangeLayout->addWidget(m_start);
rangeLayout->addWidget(endText);
......
......@@ -380,10 +380,10 @@ QRect ProjectionSurface::selectionRect() const {
}
RectF ProjectionSurface::selectionRectUV() const {
double left = static_cast<double>(m_selectRect.left());
double right = static_cast<double>(m_selectRect.right());
double top = static_cast<double>(m_selectRect.top());
double bottom = static_cast<double>(m_selectRect.bottom());
auto left = static_cast<double>(m_selectRect.left());
auto right = static_cast<double>(m_selectRect.right());
auto top = static_cast<double>(m_selectRect.top());
auto bottom = static_cast<double>(m_selectRect.bottom());
if (left > right) {
std::swap(left, right);
......
......@@ -212,8 +212,8 @@ void Viewport::applyProjection() const {
void Viewport::projectOnSphere(int a, int b, Mantid::Kernel::V3D &point) const {
// z initiaised to zero if out of the sphere
double z = 0;
double x = static_cast<double>((2.0 * a - m_width) / m_width);
double y = static_cast<double>((m_height - 2.0 * b) / m_height);
auto x = static_cast<double>((2.0 * a - m_width) / m_width);
auto y = static_cast<double>((m_height - 2.0 * b) / m_height);
double norm = x * x + y * y;
if (norm > 1.0) // The point is inside the sphere
{
......@@ -343,8 +343,8 @@ void Viewport::initZoomFrom(int a, int b) {
if (a >= m_width || b >= m_height)
return;
double z = 0;
double x = static_cast<double>(m_width - a);
double y = static_cast<double>(b - m_height);
auto x = static_cast<double>(m_width - a);
auto y = static_cast<double>(b - m_height);
m_lastpoint(x, y, z);
}
......@@ -357,7 +357,7 @@ void Viewport::initZoomFrom(int a, int b) {
void Viewport::generateZoomTo(int a, int b) {
if (a >= m_width || b >= m_height || a <= 0 || b <= 0)
return;
double y = static_cast<double>(b - m_height);
auto y = static_cast<double>(b - m_height);
if (y == 0)
y = m_lastpoint[1];
double diff = m_lastpoint[1] / y;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment