[PD] simplify item handling

according to https://github.com/FreeCAD/FreeCAD/commit/2b676020

"QListWidget::takeItem() returns a pointer to the removed item. So a previous call of QListWidget::item() is superfluous"
This commit is contained in:
donovaly
2020-09-18 00:59:33 +02:00
committed by wmayer
parent e8f5c66435
commit a44f8ffd42

View File

@@ -241,10 +241,9 @@ void TaskLoftParameters::onDeleteSection()
{
// Delete the selected profile
int row = ui->listWidgetReferences->currentRow();
QListWidgetItem* item = ui->listWidgetReferences->item(row);
QListWidgetItem* item = ui->listWidgetReferences->takeItem(row);
if (item) {
QByteArray data = item->data(Qt::UserRole).toByteArray();
ui->listWidgetReferences->takeItem(row);
delete item;
// search inside the list of sections