Removing items from the QListWidget
-
wrote on 19 Apr 2020, 16:41 last edited by
I use a list from which items are removed one at a time. The current list item is deleted. Deleting the second to last one always fails with the at () function error: index out of range.
Iterating through the list is ok, it reads and displays all the elements of the list correctly
There is more detailshow to fix it?
-
I use a list from which items are removed one at a time. The current list item is deleted. Deleting the second to last one always fails with the at () function error: index out of range.
Iterating through the list is ok, it reads and displays all the elements of the list correctly
There is more detailshow to fix it?
-
wrote on 19 Apr 2020, 18:44 last edited by
MY CODE works in signal button function
void MainWindow::on_pushButtonDELETE_clicked()
ListItem is deleted one by one for every button click
Deleting is two lines of MY CODE as you see above -
Hi,
AFAIR, you should use takeItem before deleting it.
1/4