summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-16 12:59:26 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-16 13:30:51 +0100
commit2e03a8135025e60dd6f9de5a0b4e115085a382f0 (patch)
tree73bc0392c9605d1a7f6a66736397bbdcdd5f40ea
parent0f9e8f15e6ed95c225fe3b6f9aaa22288987c9a2 (diff)
Add move constructors
To complete the set when we already have move assign operators Change-Id: I50ac1d76f1acc76faeac0db6078d72d275b77bb0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/pdf/api/qpdfdestination.h5
-rw-r--r--src/pdf/api/qpdfselection.h5
-rw-r--r--src/pdf/qpdfdestination.cpp5
-rw-r--r--src/pdf/qpdfselection.cpp11
4 files changed, 22 insertions, 4 deletions
diff --git a/src/pdf/api/qpdfdestination.h b/src/pdf/api/qpdfdestination.h
index 325863226..f9c186ff6 100644
--- a/src/pdf/api/qpdfdestination.h
+++ b/src/pdf/api/qpdfdestination.h
@@ -56,10 +56,11 @@ class Q_PDF_EXPORT QPdfDestination
Q_PROPERTY(qreal zoom READ zoom)
public:
- QPdfDestination(const QPdfDestination &other);
~QPdfDestination();
+ QPdfDestination(const QPdfDestination &other);
QPdfDestination &operator=(const QPdfDestination &other);
- inline QPdfDestination &operator=(QPdfDestination &&other) noexcept { swap(other); return *this; }
+ QPdfDestination(QPdfDestination &&other) noexcept;
+ QPdfDestination &operator=(QPdfDestination &&other) noexcept { swap(other); return *this; }
void swap(QPdfDestination &other) noexcept { d.swap(other.d); }
bool isValid() const;
int page() const;
diff --git a/src/pdf/api/qpdfselection.h b/src/pdf/api/qpdfselection.h
index a5e9280dc..5a6a1cddc 100644
--- a/src/pdf/api/qpdfselection.h
+++ b/src/pdf/api/qpdfselection.h
@@ -56,10 +56,11 @@ class Q_PDF_EXPORT QPdfSelection
Q_PROPERTY(QString text READ text)
public:
- QPdfSelection(const QPdfSelection &other);
~QPdfSelection();
+ QPdfSelection(const QPdfSelection &other);
QPdfSelection &operator=(const QPdfSelection &other);
- inline QPdfSelection &operator=(QPdfSelection &&other) noexcept { swap(other); return *this; }
+ QPdfSelection(QPdfSelection &&other) noexcept;
+ QPdfSelection &operator=(QPdfSelection &&other) noexcept { swap(other); return *this; }
void swap(QPdfSelection &other) noexcept { d.swap(other.d); }
bool isValid() const;
QVector<QPolygonF> bounds() const;
diff --git a/src/pdf/qpdfdestination.cpp b/src/pdf/qpdfdestination.cpp
index b347445e9..b70e031ca 100644
--- a/src/pdf/qpdfdestination.cpp
+++ b/src/pdf/qpdfdestination.cpp
@@ -73,6 +73,11 @@ QPdfDestination::QPdfDestination(const QPdfDestination &other)
{
}
+QPdfDestination::QPdfDestination(QPdfDestination &&other) noexcept
+ : d(std::move(other.d))
+{
+}
+
QPdfDestination::~QPdfDestination()
{
}
diff --git a/src/pdf/qpdfselection.cpp b/src/pdf/qpdfselection.cpp
index 8c3d6fde0..e334f0fb6 100644
--- a/src/pdf/qpdfselection.cpp
+++ b/src/pdf/qpdfselection.cpp
@@ -82,10 +82,21 @@ QPdfSelection::QPdfSelection(const QPdfSelection &other)
{
}
+QPdfSelection::QPdfSelection(QPdfSelection &&other) noexcept
+ : d(std::move(other.d))
+{
+}
+
QPdfSelection::~QPdfSelection()
{
}
+QPdfSelection &QPdfSelection::operator=(const QPdfSelection &other)
+{
+ d = other.d;
+ return *this;
+}
+
/*!
\property QPdfSelection::valid