A list keeps a copy of your original object.

As for your error, what is the type of tokens? Isn't it by any chance QVector? What does tokens.size() return?