aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/onlycopy.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-10-06 08:23:09 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-10-10 11:46:25 +0200
commit1faeb2e56ffdbeeed4df41b58851e51a7766c18c (patch)
tree1ab294314db37e98b2d6a6adf53d658eefa16887 /sources/shiboken6/tests/libsample/onlycopy.h
parent3c703beea87b353d0b99187830f7a1a3f3d65b2b (diff)
shiboken tests: Fix special functions for class OnlyCopy
Use a shared pointer for the Private class, so that the default copy/move can be used. Pick-to: 6.6 Task-number: PYSIDE-2479 Change-Id: Iebc75b230c7b87d47be10e10f6565eaaccb17f66 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/libsample/onlycopy.h')
-rw-r--r--sources/shiboken6/tests/libsample/onlycopy.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/shiboken6/tests/libsample/onlycopy.h b/sources/shiboken6/tests/libsample/onlycopy.h
index bd414ec34..7dc3e0069 100644
--- a/sources/shiboken6/tests/libsample/onlycopy.h
+++ b/sources/shiboken6/tests/libsample/onlycopy.h
@@ -7,6 +7,7 @@
#include "libsamplemacros.h"
#include <list>
+#include <memory>
// These classes simulate a situation found in QWebEngineHistoryItem.
@@ -15,8 +16,8 @@ class OnlyCopyPrivate;
class LIBSAMPLE_API OnlyCopy
{
public:
- OnlyCopy(const OnlyCopy &other);
- OnlyCopy &operator=(const OnlyCopy &other);
+ LIBMINIMAL_DEFAULT_COPY_MOVE(OnlyCopy)
+
~OnlyCopy();
int value() const;
@@ -24,10 +25,11 @@ public:
static int getValueFromReference(const OnlyCopy &onlyCopy) { return onlyCopy.value(); }
private:
- OnlyCopyPrivate *d;
- explicit OnlyCopy(int value);
- explicit OnlyCopy(OnlyCopyPrivate *d); // rejected due to unknown OnlyCopyPrivate
friend class FriendOfOnlyCopy;
+
+ explicit OnlyCopy(int value);
+
+ std::shared_ptr<OnlyCopyPrivate> d;
};
class LIBSAMPLE_API FriendOfOnlyCopy