qtqvectorqstringlist

QVector of QStrings, how to join?


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?


Solution

  • I do not know what your "several reasons" were supposed to be; at the very least the mid method exists for QStringList in all the supported version of Qt.

    More details:

    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.