Skip to content

Commit 8b07f39

Browse files
committed
Use std::pair instead of QPair in spectroscopy utility files
1 parent 00c974d commit 8b07f39

File tree

24 files changed

+69
-71
lines changed

24 files changed

+69
-71
lines changed

qt/scientific_interfaces/Indirect/Reduction/ISISCalibration.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,20 @@ QString ISISCalibration::backgroundString() const {
248248
void ISISCalibration::setPeakRange(const double &minimumTof, const double &maximumTof) {
249249
auto calibrationPeak = m_uiForm.ppCalibration->getRangeSelector("CalPeak");
250250
setRangeSelector(calibrationPeak, m_properties["CalPeakMin"], m_properties["CalPeakMax"],
251-
qMakePair(minimumTof, maximumTof));
251+
std::pair(minimumTof, maximumTof));
252252
}
253253

254254
void ISISCalibration::setBackgroundRange(const double &minimumTof, const double &maximumTof) {
255255
auto background = m_uiForm.ppCalibration->getRangeSelector("CalBackground");
256256
setRangeSelector(background, m_properties["CalBackMin"], m_properties["CalBackMax"],
257-
qMakePair(minimumTof, maximumTof));
257+
std::pair(minimumTof, maximumTof));
258258
}
259259

260260
void ISISCalibration::setRangeLimits(MantidWidgets::RangeSelector *rangeSelector, const double &minimum,
261261
const double &maximum, const QString &minPropertyName,
262262
const QString &maxPropertyName) {
263263
setPlotPropertyRange(rangeSelector, m_properties[minPropertyName], m_properties[maxPropertyName],
264-
qMakePair(minimum, maximum));
264+
std::pair(minimum, maximum));
265265
}
266266

267267
void ISISCalibration::setPeakRangeLimits(const double &peakMin, const double &peakMax) {
@@ -483,7 +483,7 @@ void ISISCalibration::calPlotEnergy() {
483483
}
484484

485485
const auto &dataX = energyWs->x(0);
486-
QPair<double, double> range(dataX.front(), dataX.back());
486+
std::pair<double, double> range(dataX.front(), dataX.back());
487487

488488
auto resBackground = m_uiForm.ppResolution->getRangeSelector("ResBackground");
489489
setPlotPropertyRange(resBackground, m_properties["ResStart"], m_properties["ResEnd"], range);
@@ -528,7 +528,7 @@ void ISISCalibration::calSetDefaultResolution(const MatrixWorkspace_const_sptr &
528528
if (-res * minScaleFactor > energyRange.first && res * maxScaleFactor < energyRange.second) {
529529
offset = 0.0;
530530
}
531-
QPair<double, double> peakERange(-res * minScaleFactor + offset, res * maxScaleFactor + offset);
531+
std::pair<double, double> peakERange(-res * minScaleFactor + offset, res * maxScaleFactor + offset);
532532
auto resPeak = m_uiForm.ppResolution->getRangeSelector("ResPeak");
533533
setPlotPropertyRange(resPeak, m_properties["ResELow"], m_properties["ResEHigh"], energyRange);
534534
setRangeSelector(resPeak, m_properties["ResELow"], m_properties["ResEHigh"], peakERange);
@@ -543,7 +543,7 @@ void ISISCalibration::calSetDefaultResolution(const MatrixWorkspace_const_sptr &
543543
maxScaleFactor = 15.;
544544
offset = (energyRange.second + energyRange.first) / 2.0;
545545
}
546-
QPair<double, double> backgroundERange(-res * minScaleFactor + offset, -res * maxScaleFactor + offset);
546+
std::pair<double, double> backgroundERange(-res * minScaleFactor + offset, -res * maxScaleFactor + offset);
547547
auto resBackground = m_uiForm.ppResolution->getRangeSelector("ResBackground");
548548
setRangeSelector(resBackground, m_properties["ResStart"], m_properties["ResEnd"], backgroundERange);
549549
}

qt/scientific_interfaces/Indirect/Reduction/ISISDiagnostics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@ void ISISDiagnostics::setBackgroundRangeLimits(double backgroundMin, double back
300300
void ISISDiagnostics::setRangeLimits(MantidWidgets::RangeSelector *rangeSelector, double minimum, double maximum,
301301
QString const &minPropertyName, QString const &maxPropertyName) {
302302
setPlotPropertyRange(rangeSelector, m_properties[minPropertyName], m_properties[maxPropertyName],
303-
qMakePair(minimum, maximum));
303+
std::pair(minimum, maximum));
304304
}
305305

306306
void ISISDiagnostics::setPeakRange(double minimum, double maximum) {
307307
auto slicePeak = m_uiForm.ppRawPlot->getRangeSelector("SlicePeak");
308-
setRangeSelector(slicePeak, m_properties["PeakStart"], m_properties["PeakEnd"], qMakePair(minimum, maximum));
308+
setRangeSelector(slicePeak, m_properties["PeakStart"], m_properties["PeakEnd"], std::pair(minimum, maximum));
309309
}
310310

311311
void ISISDiagnostics::setBackgroundRange(double minimum, double maximum) {
312312
auto sliceBackground = m_uiForm.ppRawPlot->getRangeSelector("SliceBackground");
313313
setRangeSelector(sliceBackground, m_properties["BackgroundStart"], m_properties["BackgroundEnd"],
314-
qMakePair(minimum, maximum));
314+
std::pair(minimum, maximum));
315315
}
316316

317317
/**

qt/scientific_interfaces/Inelastic/BayesFitting/ResNormView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void ResNormView::setMaximumSpectrum(int maximum) const { m_uiForm.spPreviewSpec
115115

116116
void ResNormView::updateSelectorRange(std::string const &filename) const {
117117
auto eRangeSelector = m_uiForm.ppPlot->getRangeSelector("ResNormViewERange");
118-
QPair<double, double> res;
118+
std::pair<double, double> res;
119119

120120
auto const range = getXRangeFromWorkspace(filename);
121121

qt/scientific_interfaces/Inelastic/Processor/ElwinView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ double ElwinView::getBackgroundEnd() { return m_dblManager->value(m_properties["
374374
* @param range :: The range to set the range selector to.
375375
*/
376376
void ElwinView::setRangeSelector(RangeSelector *rs, QtProperty *lower, QtProperty *upper,
377-
const QPair<double, double> &range,
378-
const std::optional<QPair<double, double>> &bounds) {
377+
const std::pair<double, double> &range,
378+
const std::optional<std::pair<double, double>> &bounds) {
379379
m_dblManager->setValue(lower, range.first);
380380
m_dblManager->setValue(upper, range.second);
381381
rs->setRange(range.first, range.second);

qt/scientific_interfaces/Inelastic/Processor/ElwinView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ private slots:
102102

103103
/// Function to set the range selector on the mini plot
104104
void setRangeSelector(MantidWidgets::RangeSelector *rs, QtProperty *lower, QtProperty *upper,
105-
const QPair<double, double> &range,
106-
const std::optional<QPair<double, double>> &bounds = std::nullopt);
105+
const std::pair<double, double> &range,
106+
const std::optional<std::pair<double, double>> &bounds = std::nullopt);
107107
/// Sets the min of the range selector if it is less than the max
108108
void setRangeSelectorMin(QtProperty *minProperty, QtProperty *maxProperty,
109109
MantidWidgets::RangeSelector *rangeSelector, double newValue);

qt/scientific_interfaces/Inelastic/Processor/IIqtView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MANTIDQT_INELASTIC_DLL IIqtView {
3939
virtual void setPreviewSpectrumMaximum(int value) = 0;
4040
virtual void updateDisplayedBinParameters() = 0;
4141
virtual void setRangeSelectorDefault(const Mantid::API::MatrixWorkspace_sptr inputWorkspace,
42-
const QPair<double, double> &range) = 0;
42+
const std::pair<double, double> &range) = 0;
4343
virtual void setSampleFBSuffixes(const QStringList &suffix) = 0;
4444
virtual void setSampleWSSuffixes(const QStringList &suffix) = 0;
4545
virtual void setResolutionFBSuffixes(const QStringList &suffix) = 0;

qt/scientific_interfaces/Inelastic/Processor/IMomentsView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class MANTIDQT_INELASTIC_DLL IMomentsView {
4343
virtual void setLoadHistory(bool doLoadHistory) = 0;
4444

4545
/// Function to set the range limits of the plot
46-
virtual void setPlotPropertyRange(const QPair<double, double> &bounds) = 0;
46+
virtual void setPlotPropertyRange(const std::pair<double, double> &bounds) = 0;
4747
/// Function to set the range selector on the mini plot
48-
virtual void setRangeSelector(const QPair<double, double> &bounds) = 0;
48+
virtual void setRangeSelector(const std::pair<double, double> &bounds) = 0;
4949
/// Sets the min of the range selector if it is less than the max
5050
virtual void setRangeSelectorMin(double newValue) = 0;
5151
/// Sets the max of the range selector if it is more than the min

qt/scientific_interfaces/Inelastic/Processor/ISymmetriseView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class MANTIDQT_INELASTIC_DLL ISymmetriseView {
5454
virtual void setRawPlotWatchADS(bool watchADS) = 0;
5555

5656
virtual void resetEDefaults(bool isPositive) = 0;
57-
virtual void resetEDefaults(bool isPositive, QPair<double, double> range) = 0;
57+
virtual void resetEDefaults(bool isPositive, std::pair<double, double> range) = 0;
5858

5959
virtual void previewAlgDone() = 0;
6060
virtual void enableSave(bool save) = 0;

qt/scientific_interfaces/Inelastic/Processor/IqtView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ void IqtView::plotInput(MatrixWorkspace_sptr inputWS, int spectrum) {
302302
}
303303
}
304304

305-
void IqtView::setRangeSelectorDefault(const MatrixWorkspace_sptr workspace, const QPair<double, double> &range) {
305+
void IqtView::setRangeSelectorDefault(const MatrixWorkspace_sptr workspace, const std::pair<double, double> &range) {
306306
auto xRangeSelector = m_uiForm.ppPlot->getRangeSelector("IqtRange");
307307
try {
308308
double rounded_min(range.first);

qt/scientific_interfaces/Inelastic/Processor/IqtView.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class MANTIDQT_INELASTIC_DLL IqtView : public QWidget, public IIqtView {
3939
void plotInput(MatrixWorkspace_sptr inputWS, int spectrum) override;
4040
void setPreviewSpectrumMaximum(int value) override;
4141
void updateDisplayedBinParameters() override;
42-
void setRangeSelectorDefault(const MatrixWorkspace_sptr inputWorkspace, const QPair<double, double> &range) override;
42+
void setRangeSelectorDefault(const MatrixWorkspace_sptr inputWorkspace,
43+
const std::pair<double, double> &range) override;
4344
void setSampleFBSuffixes(const QStringList &suffix) override;
4445
void setSampleWSSuffixes(const QStringList &suffix) override;
4546
void setResolutionFBSuffixes(const QStringList &suffix) override;

0 commit comments

Comments
 (0)