summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetacontainer.h
Commit message (Collapse)AuthorAgeFilesLines
* QMetaSequence and QMetaAssociation: use new comparison helper macrosTatiana Borisova2024-04-291-18/+13
| | | | | | | | | | | Replace public friend operators operator==(), operator!=() of QMetaSequence and QMetaAssociation classes to friend methods comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macroses. Task-number: QTBUG-120304 Change-Id: I88e9b228220d36092437bfb71ae2f053d2e99fdf Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QMetaContainer: add missing #include <iterator>Thiago Macieira2023-06-261-0/+2
| | | | | | | | | | For std::iterator_traits, tags, std::advance, std::distance, etc. Pick-to: 6.2 6.5 6.6 Fixes: QTBUG-114583 Change-Id: I443cf0c8a76243eead33fffd1768e904ae823f75 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QMetaContainer: Allow retrieving the d pointerUlf Hermann2023-06-211-0/+4
| | | | | | | | | | This is in line with how QMetaType handles QMetaTypeInterface*. You can retrieve a const pointer to it. Pick-to: 6.6 Task-number: QTBUG-113690 Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* 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>