From 3ef4fac9ff3f785d3ccbda4b28ec2c0ea2ee1b59 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 11 Aug 2016 13:08:00 +0300 Subject: tools: replace 'foreach' with 'range for' Mark some local variables or parameters as const to prevent detach()'ing. Use qAsConst where is not possible mark as const. Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e Reviewed-by: Shawn Rutledge --- tools/qmleasing/splineeditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/qmleasing') diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp index ee55931a46..6fee013c62 100644 --- a/tools/qmleasing/splineeditor.cpp +++ b/tools/qmleasing/splineeditor.cpp @@ -288,7 +288,7 @@ QHash SplineEditor::presets() const QString SplineEditor::generateCode() { QString s = QLatin1String("["); - foreach (const QPointF &point, m_controlPoints) { + for (const QPointF &point : qAsConst(m_controlPoints)) { s += QString::number(point.x(), 'g', 2) + QLatin1Char(',') + QString::number(point.y(), 'g', 3) + QLatin1Char(','); } -- cgit v1.2.3