summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetacontainer.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant break;s following return;sEdward Welbourne2021-09-061-2/+0
| | | | | | | Pointed out by the INTEGRITY compiler. Change-Id: Id5f9b994c348308c56c3a25200419be525b9c933 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QContainerTraits namespace to QContainerInfoLars Knoll2020-11-031-133/+133
| | | | | | | | | | | | We'll need QContainerTraits as a class for changing properties of our containers, so free up that name. This is not a problem, as the namespace is new in Qt 6 and has only been used internally so far. Change-Id: I6d6b9d9c32b92b77e66323f1fc29b3ddd8baa98f Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Core: Make the metacontainer interfaces constexprUlf Hermann2020-10-181-33/+23
| | | | | Change-Id: Ib8e486a855673b191a9854e1c4d62614a2b87e72 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make most of QMetaTypeInterface constexprUlf Hermann2020-10-181-7/+7
| | | | | | | | | | | | | | | | | | The only thing we need to modify at runtime is the typeId and that can be mutable. This way we can have a constexpr ctor for QMetaType which hopefully makes the importing and exporting of related symbols less fickle. On Windows we cannot make QMetaTypeForType constexpr as that leads to mysterious errors in other places. Until we figure out why that is, we just leave this class as non-constexpr. This reveals that qcoreapplication.h and qvariant.h are using QDebug without including it. We now get template instantiation errors. Include qdebug.h to avoid that. Change-Id: If1bf0437ada52459c59c6fa45bab3d22dfb0bc92 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a QMetaAssociationUlf Hermann2020-09-151-230/+775
| | | | | | | | | | This requires refactoring of QMetaSequence, as they share a lot of common functionality. QMetaAssociation provides a low level interface to an associative container. Task-number: QTBUG-81716 Change-Id: I273e00abd82f1549ba8803c323d82aa3a2d12ded Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaContainer: Add function to erase ranges from sequencesUlf Hermann2020-09-121-0/+19
| | | | | Change-Id: Ic51103c36d288f236106e2d3aec1401d53b97a15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QMetaSequence's d_ptr constUlf Hermann2020-09-121-1/+1
| | | | | | | The container interface should really never change. Change-Id: I31dedf5b776da97a747f0eb26f3bc83ce46f3caa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Provide methods for adding values to a sequential iterableUlf Hermann2020-09-121-28/+110
| | | | | | | | | | | Provide functionality to add and remove values, so that you can use a sequential iterable as stack or queue if the underlying container supports this. To this end, provide a way to specify whether the value should be added or removed at the beginning or the end of the iterable. Change-Id: If63d302f3ca085e56d601116ce4dfaa6b94a0c4f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMetaContainer: Add an "input" iterator capabilityUlf Hermann2020-09-121-3/+7
| | | | | | | | | For completeness' sake we should expose this. The iterators provided by QIterable and friends will check the category at runtime, and should give sensible feedback. Change-Id: I778894f340c862f79a18c6c5607bcbba98dd7598 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename QMetaSequence's "elements" to "values"Ulf Hermann2020-09-111-55/+55
| | | | | | | | | | This is so that they are in line with the "value_type" usually found in containers. Associative containers have "key_type" and "mapped_type" and we will use those names for access to elements in QMetaAssociation. Using "value" as name for sequential containers improves consistency. Change-Id: I628b7e1446bb2d56843b843bca72d279a6b247e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a QMetaSequence interfaceUlf Hermann2020-09-011-0/+594
This is in line with QMetaType and will be used to implement a mutable QSequentialIterable. Later on, a QMetaAssociation will be added as well, to implement a mutable QAssociativeIterable. The code here represents the minimal set of functionality needed to have a practical sequential container. The functionality is not completely orthogonal. In particular, the index based operations could be implemented in terms of iterator-based operations. Task-number: QTBUG-81716 Change-Id: Ibd41eb7db248a774673c701549d9a03cbf2e48b6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>