From fdabe423ba610bafe3fa8e54966654405b6e4ffb Mon Sep 17 00:00:00 2001 From: Joachim Wuttke <j.wuttke@fz-juelich.de> Date: Wed, 29 Nov 2023 23:56:20 +0100 Subject: [PATCH] tidy/readability-qualified-auto: 'auto' -> 'auto*' --- GUI/Model/Model/JobModel.cpp | 2 +- GUI/Model/Model/ParameterTuningModel.cpp | 8 ++++---- GUI/Model/ToCore/SampleToCore.cpp | 2 +- GUI/View/Canvas/IntensityDataCanvas.cpp | 2 +- GUI/View/Canvas/SpecularDataCanvas.cpp | 2 +- GUI/View/Frame/Fit1DFrame.cpp | 2 +- GUI/View/Frame/Fit2DFrame.cpp | 6 +++--- GUI/View/Instrument/DetectorEditor.cpp | 2 +- GUI/View/Scene/MaskGraphicsScene.cpp | 2 +- GUI/View/Setup/Scale1DEditor.cpp | 16 ++++++++-------- GUI/View/Setup/Scale2DEditor.cpp | 24 ++++++++++++------------ 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/GUI/Model/Model/JobModel.cpp b/GUI/Model/Model/JobModel.cpp index c71c5ce32c0..5b386d0a9c2 100644 --- a/GUI/Model/Model/JobModel.cpp +++ b/GUI/Model/Model/JobModel.cpp @@ -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; } diff --git a/GUI/Model/Model/ParameterTuningModel.cpp b/GUI/Model/Model/ParameterTuningModel.cpp index 3c7d2744171..24b9e33d76a 100644 --- a/GUI/Model/Model/ParameterTuningModel.cpp +++ b/GUI/Model/Model/ParameterTuningModel.cpp @@ -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); } diff --git a/GUI/Model/ToCore/SampleToCore.cpp b/GUI/Model/ToCore/SampleToCore.cpp index 08ba500cbe5..ecc9eff063c 100644 --- a/GUI/Model/ToCore/SampleToCore.cpp +++ b/GUI/Model/ToCore/SampleToCore.cpp @@ -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; diff --git a/GUI/View/Canvas/IntensityDataCanvas.cpp b/GUI/View/Canvas/IntensityDataCanvas.cpp index e51c202f4ec..f4ab62e5944 100644 --- a/GUI/View/Canvas/IntensityDataCanvas.cpp +++ b/GUI/View/Canvas/IntensityDataCanvas.cpp @@ -99,7 +99,7 @@ QList<QAction*> IntensityDataCanvas::actionList() void IntensityDataCanvas::onResetViewAction() { - for (auto item : allData2DItems()) + for (auto* item : allData2DItems()) item->resetView(); gProjectDocument.value()->setModified(); diff --git a/GUI/View/Canvas/SpecularDataCanvas.cpp b/GUI/View/Canvas/SpecularDataCanvas.cpp index 944ea4f567d..b2e1c454e7b 100644 --- a/GUI/View/Canvas/SpecularDataCanvas.cpp +++ b/GUI/View/Canvas/SpecularDataCanvas.cpp @@ -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(); } diff --git a/GUI/View/Frame/Fit1DFrame.cpp b/GUI/View/Frame/Fit1DFrame.cpp index cba005e2208..2e0c46c2eac 100644 --- a/GUI/View/Frame/Fit1DFrame.cpp +++ b/GUI/View/Frame/Fit1DFrame.cpp @@ -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(); diff --git a/GUI/View/Frame/Fit2DFrame.cpp b/GUI/View/Frame/Fit2DFrame.cpp index 857db0e64c6..f97e647a6cf 100644 --- a/GUI/View/Frame/Fit2DFrame.cpp +++ b/GUI/View/Frame/Fit2DFrame.cpp @@ -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); diff --git a/GUI/View/Instrument/DetectorEditor.cpp b/GUI/View/Instrument/DetectorEditor.cpp index 49200b995a7..d75b627b67f 100644 --- a/GUI/View/Instrument/DetectorEditor.cpp +++ b/GUI/View/Instrument/DetectorEditor.cpp @@ -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); diff --git a/GUI/View/Scene/MaskGraphicsScene.cpp b/GUI/View/Scene/MaskGraphicsScene.cpp index b9401775480..4ce0e1acc4b 100644 --- a/GUI/View/Scene/MaskGraphicsScene.cpp +++ b/GUI/View/Scene/MaskGraphicsScene.cpp @@ -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); diff --git a/GUI/View/Setup/Scale1DEditor.cpp b/GUI/View/Setup/Scale1DEditor.cpp index 673121b8436..10c40113e7e 100644 --- a/GUI/View/Setup/Scale1DEditor.cpp +++ b/GUI/View/Setup/Scale1DEditor.cpp @@ -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); } diff --git a/GUI/View/Setup/Scale2DEditor.cpp b/GUI/View/Setup/Scale2DEditor.cpp index c200d470ec8..74f623cf502 100644 --- a/GUI/View/Setup/Scale2DEditor.cpp +++ b/GUI/View/Setup/Scale2DEditor.cpp @@ -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(); }, -- GitLab