• Hi,
    I wanted to have a list of list of sqlRecords so I did this:

    QList<QList<QSqlRecord>> list;

    but when I do this:

    list[i].append(another list of records);

    the program crashes and when I do this:

    list.at(i).append(another list of records);

    I get this error:

    error: passing 'const QList<QSqlRecord>' as 'this' argument discards qualifiers [-fpermissive]

    What should I do?

  • Moderators

    That is because of const T &QList::at(int i) const. You are trying to mdify a const reference to the element.

    This should work.
    list[i].append(another list of records);

    BTW It should be a compile error and not a crash of your application.

  • Hi I did this and the problem was solved. it was really a silly mistake of mine and I,m sorry. you were right


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.