summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.qdoc
Commit message (Collapse)AuthorAgeFilesLines
* Fix qdoc issues in QListVolker Hilsheimer2020-10-301-2/+2
| | | | | | | | | Amends 3afd06cd43d78ef0992eaa6a458572eea6769297, member comparison operators are const. Change-Id: I10d1da4faabb6cfd528fc653ff138ab8878b32b6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Hide QList comparisons from ADLAllan Sandfeld Jensen2020-10-301-16/+12
| | | | | | | | | | Makes them member methods instead of hidden inline, as those actually gets listed in documentation, and two were already documented as such. Task-number: QTBUG-87975 Change-Id: I382ff8b701753f1fe150a38f4c530a52c98ad292 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean QList documentationAndrei Golubev2020-10-281-51/+60
| | | | | | | | | | | Updated QList documentation pieces: - Several descriptions revised - Irrelevant things removed - Descriptions wrapped at 80 characters Task-number: QTBUG-86553 Change-Id: Ic6de44520a76677aa5e8d9e91caa03e5aa198812 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QList: also default count()'s template parameterGiuseppe D'Angelo2020-10-261-1/+1
| | | | | | | | Also fix the docs. Change-Id: If08116cb8657d00d610de9451be0ba73ce19dcd1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update QList::append(const_reference) -> QList::append(parameter_type)Andrei Golubev2020-10-241-1/+1
| | | | | | | | | | Forgotten during previous round of replacing const lvalue references with parameter_type in QList methods Task-number: QTBUG-86553 Change-Id: I9abda4db3b504521b64fab1f220559c36bfeb9f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList/QVLA: fixup the docsGiuseppe D'Angelo2020-10-231-5/+5
| | | | | | | | | I'm not 100% sure that qdoc needs this, but in case it does, here's the commit. Change-Id: Ia3e17a56fd5df766c250f4875ba5e19e12b98d11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QList: make (last)IndexOf and contains function templatesGiuseppe D'Angelo2020-10-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason why they shouldn't be; one might want to do a lookup passing an object which is comparable with the list's value type (e.g. search with a QByteArrayView needle into a QByteArrayList haystack). Insofar we've had to add overloads to QListSpecialMethods for all these cases, which clearly doesn't scale and creates top-tier and low-tier lists. There is one downside, namely, calling QList<A>::indexOf(B) for a B for which there isn't an operator==(A, B) but only a conversion towards A. Before, B was converted only once (at call site), now it's converted at every call of operator==. In general: such types are broken and should be fixed on their own. However let's avoid a possible regression in client code, so I've left the QString overloads in QStringList in. To get there: centralize the implementation of those methods in a empty base class, which gets then inherited by QListSpecialMethods, which is inherited by QList. This is there are still special methods that may want to overload contains, e.g. QStringList which also passes a case sensitivity). The only breakages comes from code that was already broken, for instance mixing signed and unsigned types, and the beauty of this is that now we *detect* that instead of silently ignoring. QVLA and other QList methods will be tackled in future commits. [ChangeLog][QtCore][QList] The indexOf, lastIndexOf and contains methods now take an object of any datatype -- and not just the list's own value type. This allows for heterogenous lookup in QLists. Change-Id: Ib34812217eb2b0f926fad1fc195b33758196941c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use parameter_type in QList methodsAndrei Golubev2020-10-221-11/+11
| | | | | | | | | QList::parameter_type is defined and used to give better performance e.g. for arithmetic types. Let's use it consistently in QList API instead of const T & Change-Id: I2e12bd83f55679b55a14fbb23ab6172a9cf7bbcc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList docs: fix signature of removeAllGiuseppe D'Angelo2020-10-221-1/+1
| | | | | Change-Id: Ic52b6d9ab4b250dc931c650c6def35c18803ba43 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Convert QList alias definitions to 'using'Andrei Golubev2020-10-201-17/+9
| | | | | | | | | | | | Modern syntax for type aliases looks much nicer and is easier to read. Additionally, QDoc is able to generate better documentation for 'using' based aliases. Also, aliases are simplified for QDoc Task-number: QTBUG-86553 Change-Id: I44932fbd94f32c1463eafedd1b48c1e840b697e3 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDoc warnings for QList/QVectorAndrei Golubev2020-10-201-17/+27
| | | | | | Task-number: QTBUG-86553 Change-Id: Iac944c78640bfcfb6ee137c0ef3dd89387700b4c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QList::removeOne: make it generic as wellGiuseppe D'Angelo2020-10-201-1/+1
| | | | | | Change-Id: I0c50b2ae76f9d0f053b3d5b1ab98d12e0524e419 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList docs: remove some QVector->QList leftoversGiuseppe D'Angelo2020-10-191-41/+5
| | | | | Change-Id: I2a7b5ef07ddb07a261110914088b9942801a3c25 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update QList's documentation relevant to prepend optimizationAndrei Golubev2020-09-211-38/+65
| | | | | | Task-number: QTBUG-84320 Change-Id: I550f9dd7810855df0b0cc2bcbc78a97d6abaac7a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update QList's documentation bitsAndrei Golubev2020-09-071-44/+43
| | | | | | | | Fixed some QList documentation that described old API/behavior Change-Id: I9101ebb7bed9bcac328509765f8e9b85d63d305b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QList: Add a append(QList &&) overloadMårten Nordheim2020-08-011-0/+31
| | | | | | | | We already had append(const QList &) and now there's an overload taking an rvalue reference. Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Small fixes to the QList documentationLars Knoll2020-07-061-3/+3
| | | | | Change-Id: Ic839f7859912eb48bb192755d6f10536a0a73f8e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add support for first(n), last(n) and sliced() to QListLars Knoll2020-07-061-0/+49
| | | | | | | | | This keeps the API symmetric with what we have in our string classes. Change-Id: I94c5b39b718ca2472f9ca645e7a42e4314636f67 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify Q_ARRAY_LITERALLars Knoll2020-07-061-5/+0
| | | | | | | And clean up some unused pieces of code. Change-Id: I285b6862dc67b7130af66d3e08f652b1a56b990e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in corelib docsJarek Kobus2020-06-291-122/+120
| | | | | | | Task-number: QTBUG-84469 Task-number: QTBUG-85221 Change-Id: Ieb0ba7d82409e3c053a5788a01e92ea495505643 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Move implementation of QVector/List back to qlist.hLars Knoll2020-06-201-0/+1472
And name the main class QList. That's also the one we document. This gives less porting pain for our users, and a lot less churn in our API, as we use QList in Qt 5 in 95% of our API. In addition, it gives more consistent naming with QStringList and QByteArrayList and disambiguates QList vs QVector(2|3|4)D. Fixes: QTBUG-84468 Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>