From cd6978fd2a9397c456eac8d657e516e9c6f58bb0 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 14 Sep 2015 19:12:26 +0900 Subject: [PATCH] Added operator[] convenience function to QPtrList, similarly to QValueList. Signed-off-by: Michele Calgaro --- doc/html/qptrlist-h.html | 1 + src/tools/qptrlist.h | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/html/qptrlist-h.html b/doc/html/qptrlist-h.html index 158d7e8..5ebe21a 100644 --- a/doc/html/qptrlist-h.html +++ b/doc/html/qptrlist-h.html @@ -139,6 +139,7 @@ public: uint containsRef( const type *d ) const { return QGList::containsRef((QPtrCollection::Item)d); } bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); } + type *operator[]( uint i ) { return (type *)QGList::at(i); } type *at( uint i ) { return (type *)QGList::at(i); } int at() const { return QGList::at(); } type *current() const { return (type *)QGList::get(); } diff --git a/src/tools/qptrlist.h b/src/tools/qptrlist.h index df465fa..de6d2af 100644 --- a/src/tools/qptrlist.h +++ b/src/tools/qptrlist.h @@ -103,6 +103,7 @@ public: uint containsRef( const type *d ) const { return QGList::containsRef((QPtrCollection::Item)d); } bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); } + type *operator[]( uint i ) { return (type *)QGList::at(i); } type *at( uint i ) { return (type *)QGList::at(i); } int at() const { return QGList::at(); } type *current() const { return (type *)QGList::get(); }