summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmultimap.qdoc
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix documentation issues for Qt CoreTopi Reinio2021-08-241-16/+20
| | | | | | | | | | | | | | * Tag deprecated Q(Multi)Map operators in the header to correctly match them with documentation \fn commands. * Add documentation for QByteArrayView comparison operators. * Add a dummy typedef 'jfieldID' for generating docs correctly on non-Android platforms * Fix other minor issues Pick-to: 6.2 Task-number: QTBUG-95860 Change-Id: I141d2f75d6aa10557aa374201f09ad74b4cd6e81 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QMap: add operator+ and - for iteratorsGiuseppe D'Angelo2021-07-271-0/+32
| | | | | | | | | | | | | We missed the chance of deprecating them in 5.15, so they'll just add to the pain of porting to 6.0. We should not keep them around forever, though; QMap isn't random access and so its iterators should only have bidirectional APIs. Pick-to: 6.2 Fixes: QTBUG-95334 Change-Id: I3577f7d25e8ab793722d2f220fd27bc85c622b0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMultiMap::erase - extend docs to specify iterator limitationsIvan Solovev2021-07-121-0/+4
| | | | | | | | Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: I7cd58e010af5dd59404e37c55f6ebd91c4631b3f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-5/+5
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Improve QMap, QMultiMap descriptionKai Köhne2021-01-061-2/+1
| | | | | | | | | | | | | Make it clear that the fast lookup is by key, not by value. See also discussion in https://forum.qt.io/topic/121907/misleading-documentation-of-qhash-qmap/ Pick-to: 5.15 6.0 Change-Id: I396297e0e4674e0a1f889f4138ab52ff224c0ee2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Associative containers: add erase_ifGiuseppe D'Angelo2020-12-021-0/+29
| | | | | | | | | | | | | | | | | | | | Use a trick similar to the one we use for their ranged constructors: support predicates that either take a container's iterator, or that take a std::pair (for STL compatibility). [ChangeLog][QtCore][QMap] Added removeIf() and erase_if(). [ChangeLog][QtCore][QMultiMap] Added removeIf() and erase_if(). [ChangeLog][QtCore][QHash] Added removeIf() and erase_if(). [ChangeLog][QtCore][QMultiHash] Added removeIf() and erase_if(). Change-Id: Ie40aadf6217d7a4126a626c390d530812ebcf020 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QMap and QMultiMap comparisons hidden friendsAllan Sandfeld Jensen2020-10-291-4/+2
| | | | | | Task-number: QTBUG-87975 Change-Id: I3c84a188cdbb0d09e0e7c66588c7638c8a8328fd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Consistenly deprecate QMultiMap insert, add moving unite overloadVolker Hilsheimer2020-10-171-1/+13
| | | | | Change-Id: I8d1d30f3962b0444c27591bf45b6b3c538172039 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix qdoc warnings for QMap/QMultiMapVolker Hilsheimer2020-10-011-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | These containers have most of their operators as non-members, except those declared as hidden friends in the iterator classes, which will be fixed in qdoc. QMultiMap doesn't have an operator[] (which might be unintentional). Deprecate QMultiMap::insert/insertMulti APIs, as the documentation suggests that those are just compatibility overloads. Add documentation for the rvalue-overload of QMap/QMultiMap::insert. Note that this overload does not exist for QHash/QMultiHash. Also, it seems from the implementation that the moved-from map is not reset to the empty map if it did share data with another copy. Not addressed: QMap and QMultiMap have the special 5 implicitly generated by the compiler, so these functions are not declared anywhere, which results in qdoc warnings. qdoc could generate the documentation automatically, if it can know that those members exist. Change-Id: I0608b57c8c3793fedd304a4c7b10e607a24ad5f6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove some deprecation comments from qmap.hEdward Welbourne2020-09-211-1/+5
| | | | | | | | | Lars says documenting that the methods are slow is sufficient, no need to deprecate them. Task-number: QTBUG-85700 Change-Id: I7b1d19e91e30205df7d8198e3704cecc72a853e0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMultiMap: add constructors from QMapGiuseppe D'Angelo2020-08-101-0/+13
| | | | | | | | | | | We can provide those. They don't lose information, do not have the problem we face at offering ranged constructors (namely the order of duplicate keys), and have a distinct advantage over ranged constructors: a non-shared rvalue QMap can be "upgraded" to a QMultiMap without allocating memory for the multimap. Change-Id: Ic23c83927c05a210bc1f0050006c9f26365d3916 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve QMultiMap docs a bitGiuseppe D'Angelo2020-08-101-1/+8
| | | | | Change-Id: I170dc5de15dac61620aaed94f32226c158092dce Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMultiMap: add range eraseGiuseppe D'Angelo2020-08-061-0/+11
| | | | | | | | Also remove duplication by centralizing the main code for erase(), and implement erase(pos) in terms of erase(first, last). Change-Id: Ie0272ebac92fd7da48c31f9d68e69a2faa583bbc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-061-0/+1465
... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>