for (int i = 0; i< ui->listWidget->count(); i++) { t = 0; for (int j = 0; j< ui->listWidget->count(); j++) { if (ui->listWidget->item(i)->text() == ui->listWidget->item(j)->text()) { t++; if (t > 1) delete ui->listWidget->takeItem(j); } } }
C++ (Qt)for (int i = 0; i < listWidget->count(); i++) { for (int j = i + 1; j < listWidget->count(); j++) { if (listWidget->item (i)->text () == listWidget->item (j)->text ()) { delete ui->listWidget->takeItem(j); j--; } }}
C++ (Qt)listWidget->item (i)->text () == listWidget->item (i)->text ()