Due to several reasons, e.g. the mid
method, I would prefer to use a QVector<QString>
over QStringList
.
The only downside I face is that I also have to join the elements from time to time to a single QString.
In QStringlist that is easy, you can simply use join(',')
, but how to do that when using a QVector<QString>
without writing a dedicated function? Is there something like a .map()
method?
I do not know what your "several reasons" were supposed to be; at the very least the
mid
method exists forQStringList
in all the supported version of Qt.More details:
Qt 5.15 LTS has a
mid
method forQStringList
, is the last supported version of Qt5, and goes out of standard support by end of May 2023, out of subscribers' support in 2025.QVector
andQList
are now the exact same type. By extension, aQStringList
is aQVector<QString>
.Conclusion: your question will not make sense in just 3 months (27 months if you are a subscriber) and if just talking about a
mid
method, it was in fact already present.