#1281

Export Iter structs

Openjnboothopened 1y ago

QHash, QList, QMap, QSet, and QVector all have corresponding Iter structs. However, those structs are not exported by cxx-qt-lib. That means users cannot use them as return values or in structs.

I think the simplest solution here would be to simply make the qhash, qlist, qmap, qset, and qvector modules public. Then users could use e.g. cxx_qt_lib::qvector::Iter. This approach parallels the standard library, e.g. std::slice::Iter. I considered making a PR to do that, but I figured it would probably be a better idea to check in first about how we want to handle the situation.

Activity

1
LeonMatthesKDAB1y ago

@jnbooth Thank you for checking in with us before opening a PR. This sounds useful to have, as long as we make sure the API of Iter is only limited to publicly implementing the Iterator trait.

@ahayzen-kdab I think this is also good opportunity to move towards include paths that include the module name.

e.g. for types like this we want to use:

use cxx_qt_lib::core::qvector::Iter;

We're considering moving towards fully qualifying the modules inside CXX-Qt-lib anyway, e.g.:

use cxx_qt_lib::core::QString;

We still need to consider whether we want to break API and remove the current includes or not. But that's not something that we need to do as part of this issue.