File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -449,14 +449,13 @@ void QgsAttributeTableView::onActionColumnItemPainted( const QModelIndex &index
449
449
450
450
void QgsAttributeTableView::recreateActionWidgets ()
451
451
{
452
- QMap< QModelIndex, QWidget * > newWidgets;
453
452
QMap< QModelIndex, QWidget * >::const_iterator it = mActionWidgets .constBegin ();
454
453
for ( ; it != mActionWidgets .constEnd (); ++it )
455
454
{
456
- it. value ()-> deleteLater (); // ?
457
- QWidget *widget = createActionWidget ( mFilterModel -> data ( it. key (), QgsAttributeTableModel::FeatureIdRole ). toLongLong () );
458
- newWidgets. insert ( it. key (), widget );
459
- setIndexWidget ( it.key (), widget );
455
+ // ownership of widget was transferred by initial call to setIndexWidget - clearing
456
+ // the index widget will delete the old widget safely
457
+ // they should then be recreated by onActionColumnItemPainted
458
+ setIndexWidget ( it.key (), nullptr );
460
459
}
461
- mActionWidgets = newWidgets ;
460
+ mActionWidgets . clear () ;
462
461
}
You can’t perform that action at this time.
0 commit comments