Skip to content
Snippets Groups Projects
Commit fdabe423 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

tidy/readability-qualified-auto: 'auto' -> 'auto*'

parent 4e79961b
No related branches found
No related tags found
1 merge request!2185cleanup suggested by clang-tidy
......@@ -51,7 +51,7 @@ JobItem* JobModel::jobItemForIdentifier(const QString& identifier)
JobItem* JobModel::createJobItem()
{
auto jobItem = new JobItem();
auto* jobItem = new JobItem();
m_jobItems.emplace_back(jobItem);
return jobItem;
}
......
......@@ -65,7 +65,7 @@ QVariant ParameterTuningModel::data(const QModelIndex& index, int role) const
return {};
}
if (auto var = toParameterItem(index)) {
if (auto* var = toParameterItem(index)) {
if (role == Qt::DisplayRole || role == Qt::EditRole) {
if (index.column() == 0)
return var->title();
......@@ -96,7 +96,7 @@ QModelIndex ParameterTuningModel::index(int row, int column, const QModelIndex&
if (!parent.isValid())
return createIndex(row, column, m_rootObject->children()[row]);
if (auto label = toParameterLabelItem(parent))
if (auto* label = toParameterLabelItem(parent))
return createIndex(row, column, label->children()[row]);
return {};
......@@ -189,12 +189,12 @@ ParameterLabelItem* ParameterTuningModel::toParameterLabelItem(const QModelIndex
void ParameterTuningModel::setExpanded(const QModelIndex& index) const
{
if (auto label = toParameterLabelItem(index))
if (auto* label = toParameterLabelItem(index))
label->setCollapsed(false);
}
void ParameterTuningModel::setCollapsed(const QModelIndex& index) const
{
if (auto label = toParameterLabelItem(index))
if (auto* label = toParameterLabelItem(index))
label->setCollapsed(true);
}
......@@ -81,7 +81,7 @@ std::unique_ptr<IParticle> createIParticle(const ItemWithParticles& item)
std::unique_ptr<ParticleLayout> buildParticleLayout(const ParticleLayoutItem& item)
{
auto layout = createParticleLayout(item);
for (auto particleItem : item.itemsWithParticles()) {
for (auto* particleItem : item.itemsWithParticles()) {
if (auto particle = createIParticle(*particleItem)) {
layout->addParticle(*particle);
continue;
......
......@@ -99,7 +99,7 @@ QList<QAction*> IntensityDataCanvas::actionList()
void IntensityDataCanvas::onResetViewAction()
{
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->resetView();
gProjectDocument.value()->setModified();
......
......@@ -92,7 +92,7 @@ void SpecularDataCanvas::enableDeprecatedOnMousePress(bool b)
void SpecularDataCanvas::onResetViewAction()
{
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
item->resetView();
gProjectDocument.value()->setModified();
}
......
......@@ -82,7 +82,7 @@ Fit1DFrame::Fit1DFrame(QWidget* parent)
void Fit1DFrame::setJobOrDatafileItem(QObject* item)
{
auto job_item = dynamic_cast<JobItem*>(item);
auto* job_item = dynamic_cast<JobItem*>(item);
ASSERT(job_item);
JobItem* oldJob = jobItem();
......
......@@ -84,7 +84,7 @@ Fit2DFrame::Fit2DFrame()
void Fit2DFrame::setJobOrDatafileItem(QObject* item)
{
auto job_item = dynamic_cast<JobItem*>(item);
auto* job_item = dynamic_cast<JobItem*>(item);
ASSERT(job_item);
JobItem* oldJob = jobItem();
......@@ -124,8 +124,8 @@ void Fit2DFrame::onResetViewAction()
void Fit2DFrame::connectItems()
{
// sync XY view area between simulated, real and difference plots
for (auto senderItem : allData2DItems())
for (auto receiverItem : allData2DItems())
for (auto* senderItem : allData2DItems())
for (auto* receiverItem : allData2DItems())
if (receiverItem != senderItem)
connect(senderItem, &DataItem::updateOtherPlots, receiverItem,
&DataItem::checkXYranges, Qt::UniqueConnection);
......
......@@ -49,7 +49,7 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrItem)
auto* resolutionForm = new StaticGroupBox("Resolution function", this);
xyrow->addWidget(resolutionForm);
auto resolutionLayout = new QFormLayout;
auto* resolutionLayout = new QFormLayout;
resolutionForm->body()->setLayout(resolutionLayout);
resolutionLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
......
......@@ -387,7 +387,7 @@ void MaskGraphicsScene::updateViews()
maskView->addView(itemView);
// Add views for the points of the PolygonItem
if (auto polygonItem = dynamic_cast<PolygonItem*>(maskItem)) {
if (auto* polygonItem = dynamic_cast<PolygonItem*>(maskItem)) {
IShapeDisplay* const polygonView = itemView;
for (PolygonPointItem* pointItem : polygonItem->points()) {
IShapeDisplay* pointView = addViewForItem(pointItem);
......
......@@ -37,7 +37,7 @@ void Scale1DEditor::createPanelElements()
if (allData1DItems().size() == 0)
return;
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
disconnect(item, nullptr, this, nullptr);
GUI::Util::Layout::clearLayout(m_mainLayout);
......@@ -66,7 +66,7 @@ void Scale1DEditor::createPanelElements()
xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[this] { return currentData1DItem()->axItemX()->min(); },
[this](double newValue) {
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
item->axItemX()->setMin(newValue);
gProjectDocument.value()->setModified();
},
......@@ -75,7 +75,7 @@ void Scale1DEditor::createPanelElements()
xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[this] { return currentData1DItem()->axItemX()->max(); },
[this](double newValue) {
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
item->axItemX()->setMax(newValue);
gProjectDocument.value()->setModified();
},
......@@ -92,7 +92,7 @@ void Scale1DEditor::createPanelElements()
auto* logRangeSpinbox = GUI::Util::createDoubleSpinbox(
[this] { return currentData1DItem()->axItemY()->logRangeOrders(); },
[this](double newValue) {
for (auto item : mainData1DItems()) {
for (auto* item : mainData1DItems()) {
item->axItemY()->setLogRangeOrders(newValue);
updateUIValues();
}
......@@ -103,7 +103,7 @@ void Scale1DEditor::createPanelElements()
yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[this] { return currentData1DItem()->axItemY()->min(); },
[this](double newValue) {
for (auto item : mainData1DItems()) {
for (auto* item : mainData1DItems()) {
item->axItemY()->setMin(newValue);
item->axItemY()->adjustLogRangeOrders();
updateUIValues();
......@@ -115,7 +115,7 @@ void Scale1DEditor::createPanelElements()
yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[this] { return currentData1DItem()->axItemY()->max(); },
[this](double newValue) {
for (auto item : mainData1DItems()) {
for (auto* item : mainData1DItems()) {
item->axItemY()->setMax(newValue);
item->axItemY()->adjustLogRangeOrders();
updateUIValues();
......@@ -128,7 +128,7 @@ void Scale1DEditor::createPanelElements()
"log10", [this] { return currentData1DItem()->axItemY()->isLogScale(); },
[this, logRangeSpinbox](bool b) {
logRangeSpinbox->setEnabled(b);
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
item->axItemY()->setLogScale(b);
gProjectDocument.value()->setModified();
},
......@@ -145,7 +145,7 @@ void Scale1DEditor::createPanelElements()
&Scale1DEditor::updateUIValues, Qt::UniqueConnection);
// update coordinates on axes units change
for (auto item : allData1DItems())
for (auto* item : allData1DItems())
connect(item, &DataItem::axesUnitsChanged, this, &Scale1DEditor::updateItemCoords,
Qt::UniqueConnection);
}
......@@ -34,7 +34,7 @@ Scale2DEditor::Scale2DEditor(QWidget* parent)
void Scale2DEditor::unsubscribe()
{
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
disconnect(item, nullptr, this, nullptr);
}
......@@ -65,7 +65,7 @@ void Scale2DEditor::createPanelElements()
"Color scheme:",
GUI::Util::createComboBox([this] { return currentData2DItem()->gradientCombo(); },
[this](const QString& newVal) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->setCurrentGradient(newVal);
gProjectDocument.value()->setModified();
},
......@@ -74,7 +74,7 @@ void Scale2DEditor::createPanelElements()
m_mainLayout->addRow(GUI::Util::createCheckBox(
"Interpolate", [this] { return currentData2DItem()->isInterpolated(); },
[this](bool b) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->setInterpolated(b);
gProjectDocument.value()->setModified();
},
......@@ -89,7 +89,7 @@ void Scale2DEditor::createPanelElements()
xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->axItemX()->min(); },
[this](double newValue) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->axItemX()->setMin(newValue);
gProjectDocument.value()->setModified();
},
......@@ -98,7 +98,7 @@ void Scale2DEditor::createPanelElements()
xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->axItemX()->max(); },
[this](double newValue) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->axItemX()->setMax(newValue);
gProjectDocument.value()->setModified();
},
......@@ -115,7 +115,7 @@ void Scale2DEditor::createPanelElements()
yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->axItemY()->min(); },
[this](double newValue) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->axItemY()->setMin(newValue);
gProjectDocument.value()->setModified();
},
......@@ -124,7 +124,7 @@ void Scale2DEditor::createPanelElements()
yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->axItemY()->max(); },
[this](double newValue) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->axItemY()->setMax(newValue);
gProjectDocument.value()->setModified();
},
......@@ -141,7 +141,7 @@ void Scale2DEditor::createPanelElements()
auto* logRangeSpinbox = GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->zAxisItem()->logRangeOrders(); },
[this](double newValue) {
for (auto item : mainData2DItems()) {
for (auto* item : mainData2DItems()) {
item->zAxisItem()->setLogRangeOrders(newValue);
updateUIValues();
}
......@@ -152,7 +152,7 @@ void Scale2DEditor::createPanelElements()
zFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->zAxisItem()->min(); },
[this](double newValue) {
for (auto item : allData2DItems()) {
for (auto* item : allData2DItems()) {
item->zAxisItem()->setMin(newValue);
item->zAxisItem()->adjustLogRangeOrders();
updateUIValues();
......@@ -164,7 +164,7 @@ void Scale2DEditor::createPanelElements()
zFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox(
[this] { return currentData2DItem()->zAxisItem()->max(); },
[this](double newValue) {
for (auto item : mainData2DItems()) {
for (auto* item : mainData2DItems()) {
item->zAxisItem()->setMax(newValue);
item->zAxisItem()->adjustLogRangeOrders();
updateUIValues();
......@@ -177,7 +177,7 @@ void Scale2DEditor::createPanelElements()
"log10", [this] { return currentData2DItem()->zAxisItem()->isLogScale(); },
[this, logRangeSpinbox](bool b) {
logRangeSpinbox->setEnabled(b);
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->zAxisItem()->setLogScale(b);
gProjectDocument.value()->setModified();
},
......@@ -188,7 +188,7 @@ void Scale2DEditor::createPanelElements()
zFormLayout->addRow(GUI::Util::createCheckBox(
"Visible", [this] { return currentData2DItem()->zAxisItem()->isVisible(); },
[this](bool b) {
for (auto item : allData2DItems())
for (auto* item : allData2DItems())
item->zAxisItem()->setVisible(b);
gProjectDocument.value()->setModified();
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment