[PD] simplify item handling

according to https://github.com/FreeCAD/FreeCAD/commit/c1fd0320

"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 32f8c66e02
commit 78efc9c34f

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