[solved] Deleting element form QList does not change count()
Hi there,
I have put several tasks in a QList and when the task is done it shall be deleted form the list. If I do
Code:
iniTextList.removeFirst();
the first element disappears but iniList.count(); still gives me the initial number of elements. I guess removeFirst() does not "shrink" the list, the list still got n values just the first is empty and therefore not displayed. Is there a way to shorten the list?
[EDIT]
Sorry for the post! I just realized that I was deleting elements from the view and counted the elements of the underlying list.
Re: [solved] Deleting element form QList does not change count()
Just in case your code actually looks like that: this leaks string list models.
Cheers,
_