summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-12 01:29:19 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-06-23 13:51:20 +0000
commit43c410867b5eccea2e0f7eeceabad76d5f874101 (patch)
tree23821d4db55454dada71cedae75e45130e234503 /src/corelib/tools
parent7000b70821493222ea2af10aae420b8cdd830953 (diff)
QVector: add a construction from QArrayDataPointerRef
To be used to build QVectors out of Q_ARRAY_LITERALs. Change-Id: I6105fd1f2d13f6ce923b79276b4aa7a7f5eff193 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qvector.h1
-rw-r--r--src/corelib/tools/qvector.qdoc5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 5d68a283bd..65a5174abf 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -80,6 +80,7 @@ public:
QVector<T> &operator=(std::initializer_list<T> args);
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
inline QVector(InputIterator first, InputIterator last);
+ explicit QVector(QArrayDataPointerRef<T> ref) noexcept : d(ref.ptr) {}
bool operator==(const QVector<T> &v) const;
inline bool operator!=(const QVector<T> &v) const { return !(*this == v); }
diff --git a/src/corelib/tools/qvector.qdoc b/src/corelib/tools/qvector.qdoc
index c1b5054f93..4c442511ea 100644
--- a/src/corelib/tools/qvector.qdoc
+++ b/src/corelib/tools/qvector.qdoc
@@ -251,6 +251,11 @@
The value type of \c InputIterator must be convertible to \c T.
*/
+/*!
+ \fn template <typename T> QVector<T>::QVector(QArrayDataPointerRef<T> ref)
+ \internal
+*/
+
/*! \fn template <typename T> QVector<T>::~QVector()
Destroys the vector.