From 343cc50c224655ba8da5cc02d263a9b70f10d529 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 31 Dec 2024 23:01:58 +0200 Subject: [PATCH] QList: add data_ptr() methods like the ones in QString/QBA It will be used in a suqsequent commit (adding QString::{to,from}Utf32). Change-Id: Ie113a47f0ff0e9a7b26a6d0f47e17d24a4a88465 Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 3 +++ src/corelib/tools/qlist.qdoc | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 45ecac01574..30c78c2c4dc 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -107,6 +107,9 @@ public: using rvalue_ref = T &&; #endif + DataPointer &data_ptr() { return d; } + const DataPointer &data_ptr() const { return d; } + class const_iterator; class iterator { friend class QList; diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index 9b540e110c1..ce7dabe39b2 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -1638,3 +1638,11 @@ This function only allocates memory if the number of elements in \a l exceeds the capacity of this list or this list is shared. */ + +/*! + \fn template QList::DataPointer &QList::data_ptr(); + \fn template const QList::DataPointer &QList::data_ptr() const; + + \internal + \since 6.10 +*/