tzudemom
tzudemom

Reputation: 45

Append a QVector in a QList

I want to append a QVector in a QList but the QVector does not append. The size does not change. I try this with:

y.value(i).append(var);

Variable y is declared as QList<QVector<double>> y;.

Upvotes: 0

Views: 617

Answers (1)

Mitch
Mitch

Reputation: 24416

QList::value() returns a copy of the element at the given index, not a reference, so modifying it has no effect. Try operator[] instead.

Upvotes: 4

Related Questions