aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/functions.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-07-26 11:50:09 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-08-01 11:24:34 +0200
commitb8c5e37cbe9c58bbee00c60646935e76313ab0da (patch)
treee2d53d3905120145541979efcf32f49096edc2c0 /sources/shiboken6/tests/libsample/functions.cpp
parent5a0eb0f30c6d2db0d3b023cff9e1851781d184d2 (diff)
Add experimental support for rvalue references
Enable functions taking rvalue references if they are user-defined in some way. Enabling by default is not done since there are cases in which several overloads exist (QSqlQueryModel::setQuery(QSqlQuery)). In these cases, they should not be part of the candidate list. [ChangeLog][shiboken6] Experimental support for rvalue references has been added. Task-number: PYSIDE-2394 Task-number: PYSIDE-1790 Change-Id: Ie2eb60ef19ddac321126b64cd0c35913bd805b48 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/libsample/functions.cpp')
-rw-r--r--sources/shiboken6/tests/libsample/functions.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/functions.cpp b/sources/shiboken6/tests/libsample/functions.cpp
index 6f46f89df..6141af8df 100644
--- a/sources/shiboken6/tests/libsample/functions.cpp
+++ b/sources/shiboken6/tests/libsample/functions.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "functions.h"
+#include "polygon.h"
#include <cstring>
#include <algorithm>
@@ -219,3 +220,17 @@ void testNullPtrT(std::nullptr_t)
{
std::cout << __FUNCTION__ << '\n';
}
+
+int takePolygon(Polygon &&p)
+{
+ auto p2 = std::move(p);
+ std::cout << __FUNCTION__ << ' ' << p2.points().size() << " points\n";
+ return int(p2.points().size());
+}
+
+int takeObjectType(ObjectType &&o)
+{
+ auto o2 = std::move(o);
+ std::cout << __FUNCTION__ << ' ' << o2.objectName().cstring() << '\n';
+ return o2.objectName().size();
+}