PDA

View Full Version : dynamic array of QStringList and QList



timmu
24th February 2014, 17:20
I could use some help with declaring QStringList and QList dynamically:

During runtime I need to declare N QStringLists and QLists with length L. Would someone be able to help with an example of how to do this.

Thank you so much!!

anda_skoa
24th February 2014, 19:02
You mean a list of list?

Cheers,
_

timmu
24th February 2014, 19:19
Hi,

Yes, I mean a list of lists.
Example:

1: andy, mary, joe
2: james, george, john, jim
3: jeremy, jane

Thanks!

ChrisW67
24th February 2014, 20:05
QList<QStringList> list;
// or if L is known and likely to be reasonably fixed
const int L = 10;
QVector<QStringList> list(L);