[SOLVED]Multidimensional array
General and Desktop
4
Posts
3
Posters
6.3k
Views
1
Watching
-
Hi guys,
I'm trying to use a multidimensional array:
@
QList<QList<QVariant> > info;
//Append QList<QVariant> works...
info.at(0).append(query->value(0));
@When I try do append same data at info (line 3) I have the error: "error: passing 'const QList<QVariant>' as 'this' argument of 'void QList<T>::append(const T&) [with T = QVariant]' discards qualifiers"
Does anyone has a clue of how to fix this?
Thanks.
-
at() returns const reference. Use operator [] instead to modify the list element (the append() modifies it).