summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qiterable.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove default ctor for QIterableUlf Hermann2020-09-221-2/+0
| | | | | | | MSVC has strange problems with it and we don't actually need it. Change-Id: I2c443946d52d475208800f310b5f910da165c99b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaType: Allow registration of mutable views and register iterablesUlf Hermann2020-09-191-3/+1
| | | | | | | | | | | | | | | In order to modify a container through an iterable, we need the original container to be mutable. The iterable, then, is not a conversion of the container, but rather a view on the container. The concept may be extended to other types. In order to facilitate this, provide a set of methods in QMetaType and QVariant similar to the convert family. The new methods are non-const and expect the original value to stay available during the life time of the view. Change-Id: I363621033f7fc600edcea2acb786820ccba49c86 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Extend QSequentialIterable and add QAssociativeIterableUlf Hermann2020-09-191-74/+412
| | | | | | | | | And add mutable iterators. This requires some refactoring of the existing iterators. Task-number: QTBUG-81716 Change-Id: I61b3a3e8c0df5fd449679257a29d9f0c3d19c4f0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Provide methods for adding values to a sequential iterableUlf Hermann2020-09-121-0/+10
| | | | | | | | | | | 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>
* Prepare QSequentialIterable for non-const operationUlf Hermann2020-09-111-3/+57
| | | | | | | | | Introduce a smart pointer that saves its constness, even if the constness of the parent object changes. This allows us to implement the const and mutable iterators in the same class. Change-Id: I156e564c7fa2ecc8981c6d71861d796a5cbfec66 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warning from unused private field in QSequentialIterableVolker Hilsheimer2020-09-051-0/+1
| | | | | Change-Id: I9c330b4f99f77404eacda2506d264f917f9e1161 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Reimplement QSequentialIterable using QMetaSequenceUlf Hermann2020-09-031-0/+149
Change-Id: Ie721a5f0caa697c4bf15a81f3762cf79d3c54f5a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>