Skip to content
Snippets Groups Projects
Commit 4383c79f authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Fix Qt5.14 warnings related to vector construction

parent 209d03e4
No related branches found
No related tags found
No related merge requests found
......@@ -155,8 +155,18 @@ QPair<QVector<double>, QVector<double>> Data1DViewItem::graphData(Data1DProperti
const auto data = DataViewUtils::getTranslatedData(this, property_item->dataItem());
if (!data)
return {};
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
auto centers = data->getAxis(0).getBinCenters();
auto values = data->getRawDataVector();
return {QVector<double>(centers.begin(), centers.end()),
QVector<double>(values.begin(), values.end())};
#else
return {QVector<double>::fromStdVector(data->getAxis(0).getBinCenters()),
QVector<double>::fromStdVector(data->getRawDataVector())};
#endif
}
JobItem* Data1DViewItem::jobItem()
......
......@@ -126,9 +126,20 @@ SaveProjectionsAssistant::projectionsData(const QString& projectionsType,
data.axis_value = item->getItemValue(VerticalLineItem::P_POSX).toDouble();
hist.reset(m_hist2d->projectionY(data.axis_value));
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
auto values = hist->getBinValues();
auto centers = hist->getBinCenters();
data.bin_values = QVector<double>(values.begin(), values.end());
if (result.bin_centers.isEmpty())
result.bin_centers = QVector<double>(centers.begin(), centers.end());
#else
data.bin_values = QVector<double>::fromStdVector(hist->getBinValues());
if (result.bin_centers.isEmpty())
result.bin_centers = QVector<double>::fromStdVector(hist->getBinCenters());
#endif
result.projections.push_back(data);
}
......
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