Use takeAt() instead of at()
Qt Code:
//int cnt = list.count(); //for(int i = 0; i < cnt; i++) // delete list.takeAt(i); //list.clear(); while(list.count()) delete list.takeAt(0);To copy to clipboard, switch view to plain text mode
Use takeAt() instead of at()
Qt Code:
//int cnt = list.count(); //for(int i = 0; i < cnt; i++) // delete list.takeAt(i); //list.clear(); while(list.count()) delete list.takeAt(0);To copy to clipboard, switch view to plain text mode
at() should be ok too. The problem is elsewhere. What is the value of cnt in line #13?
Agree, it is valid and working code (or it would be if int would be added before"i" in the first loop).
Bookmarks