aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-05-21 11:38:15 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-05-22 21:07:45 +0000
commitcacab19b31ebfa0f3676643031a56d3a8ccd2bea (patch)
treee8944d860bb1ae1ec4cbbcaef3fbe25c8388fedb /src/plugins
parent103867c03b6dd9a5634660acb839056460f92335 (diff)
Port from qAsConst() to std::as_const()
QBS has been requiring C++17 since at least 1.18, probably earlier. Providing qAsConst() is finally starting to bother Qt (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I51154f8c5d283a90b1db89bcb4b6a7671edca0f0 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp2
-rw-r--r--src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp2
-rw-r--r--src/plugins/generator/makefilegenerator/makefilegenerator.cpp6
-rw-r--r--src/plugins/generator/visualstudio/visualstudiogenerator.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
index 2fa3cfa6a..b3b68377f 100644
--- a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
+++ b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp
@@ -230,7 +230,7 @@ struct TargetPageOptions final
}
const QString toolkitPath = IarewUtils::toolkitRootPath(qbsProduct);
- for (const QVariant &configPath : qAsConst(configPaths)) {
+ for (const QVariant &configPath : std::as_const(configPaths)) {
const QString fullConfigPath = configPath.toString();
// We interested only in a config paths shipped inside of a toolkit.
if (!fullConfigPath.startsWith(toolkitPath, Qt::CaseInsensitive))
diff --git a/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp b/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp
index 52a19cf81..f2bc8367e 100644
--- a/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp
+++ b/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp
@@ -101,7 +101,7 @@ struct LinkerPageOptions final
if (scatterFiles.count() > 0)
mainScatterFile = scatterFiles.takeFirst();
- for (const auto &scatterFile : qAsConst(scatterFiles)) {
+ for (const auto &scatterFile : std::as_const(scatterFiles)) {
const auto control = QStringLiteral("--scatter %1").arg(scatterFile);
miscControls.push_back(control);
}
diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
index c53dccd31..690d83569 100644
--- a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
+++ b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
@@ -332,15 +332,15 @@ void qbs::MakefileGenerator::generate()
}
stream << "all:";
- for (const QString &target : qAsConst(allDefaultTargets))
+ for (const QString &target : std::as_const(allDefaultTargets))
stream << ' ' << target;
stream << '\n';
stream << "install:";
- for (const QString &target : qAsConst(allDefaultTargets))
+ for (const QString &target : std::as_const(allDefaultTargets))
stream << ' ' << "install-" << target;
stream << '\n';
stream << "clean:";
- for (const QString &target : qAsConst(allTargets))
+ for (const QString &target : std::as_const(allTargets))
stream << ' ' << "clean-" << target;
stream << '\n';
if (!filesCreatedByJsCommands.empty()) {
diff --git a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp
index d0c367dd7..d6add9c6f 100644
--- a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp
+++ b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp
@@ -189,7 +189,7 @@ void VisualStudioGenerator::addPropertySheets(const GeneratableProject &project)
void VisualStudioGenerator::addPropertySheets(
const std::shared_ptr<MSBuildTargetProject> &targetProject)
{
- for (const auto &pair : qAsConst(d->propertySheetNames)) {
+ for (const auto &pair : std::as_const(d->propertySheetNames)) {
targetProject->appendPropertySheet(
QStringLiteral("$(SolutionDir)\\") + pair.first, pair.second);
}