mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-23 00:05:43 -04:00
Fix crash in attribute table when action column is visible and edit is
toggled
This commit is contained in:
parent
1efb3cb9b0
commit
3d8dd4913c
@ -449,14 +449,13 @@ void QgsAttributeTableView::onActionColumnItemPainted( const QModelIndex &index
|
|||||||
|
|
||||||
void QgsAttributeTableView::recreateActionWidgets()
|
void QgsAttributeTableView::recreateActionWidgets()
|
||||||
{
|
{
|
||||||
QMap< QModelIndex, QWidget * > newWidgets;
|
|
||||||
QMap< QModelIndex, QWidget * >::const_iterator it = mActionWidgets.constBegin();
|
QMap< QModelIndex, QWidget * >::const_iterator it = mActionWidgets.constBegin();
|
||||||
for ( ; it != mActionWidgets.constEnd(); ++it )
|
for ( ; it != mActionWidgets.constEnd(); ++it )
|
||||||
{
|
{
|
||||||
it.value()->deleteLater(); //?
|
// ownership of widget was transferred by initial call to setIndexWidget - clearing
|
||||||
QWidget *widget = createActionWidget( mFilterModel->data( it.key(), QgsAttributeTableModel::FeatureIdRole ).toLongLong() );
|
// the index widget will delete the old widget safely
|
||||||
newWidgets.insert( it.key(), widget );
|
// they should then be recreated by onActionColumnItemPainted
|
||||||
setIndexWidget( it.key(), widget );
|
setIndexWidget( it.key(), nullptr );
|
||||||
}
|
}
|
||||||
mActionWidgets = newWidgets;
|
mActionWidgets.clear();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user