summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBrett Stottlemyer <bstottle@ford.com>2021-07-20 07:44:55 -0400
committerBrett Stottlemyer <bstottle@ford.com>2021-08-04 10:42:18 -0400
commitf43e2918d05df688c19d3164b43418747d4ac2ef (patch)
tree4ea15423c76fc79db30f0c159d465bbd210fabf5 /tools
parent6892ef6d4577410385e315a4366aa3b6e449c435 (diff)
Refactor decodeVariant to pass by rvalue ref/std::move
The decodeVariant calls were weird in how their parameters were pass by reference so they could be changed, but without forcing a copy. It is clearer to pass by rvalue ref, using std::move on the calling side. This rippled up to calls that called the method, including setProperties which is part of the repc generated code. Because of the repc change, this should *not* be picked to Qt5. Pick-to: 6.2 Change-Id: Ieb1b0620569ad8eb9797edc57cc189d0b426510c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/repc/repcodegenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/repc/repcodegenerator.cpp b/tools/repc/repcodegenerator.cpp
index ac58130..2f67f92 100644
--- a/tools/repc/repcodegenerator.cpp
+++ b/tools/repc/repcodegenerator.cpp
@@ -742,7 +742,7 @@ void RepCodeGenerator::generateClass(Mode mode, QTextStream &out, const ASTClass
}
out << " }" << Qt::endl;
}
- out << " setProperties(properties);" << Qt::endl;
+ out << " setProperties(std::move(properties));" << Qt::endl;
out << " }" << Qt::endl;
} else if (mode == SOURCE) {
out << " explicit " << className << "(QObject *parent = nullptr) : QObject(parent)" << Qt::endl;