Search code examples
qt5qstringlist

Split QStringList in Chucks


Is there a function in QT to split a QStringList into sections/chunks?

For example, I have a QStringList with 100 items. I what to split it into 3. So for example I could get a

<QVector QStringList> sections;

with 3 sections: 1 section with 33 items, 2 section with 33 items, and 3 section with 34 items.

I can write a function for that but I was wondering if it's already there somewhere in QT


Solution

  • There is no such function in Qt. For further reference on what is possible with QStringList and what isn't check out the documentation