I’m wondering about what happens when I delete a QVector’s item?
- Is it automatically removed from the
QVector? - Do I have to remove it manually?
Also, how can I find out the index of an iteration of the iterator?
Best regards
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have a
QVector<Thing*>anddeleteone of theThings that stored in it, it will not be removed automatically from the vector. You need to do that yourself.As far as I know, and from what I read in the docs, none of the
QVectoriterators has a method to tell at what index it is positioned.But if you have a reference to the vector itself (or at least to it’s
begin()iterator), you can use: