mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[dualview] Fix crash when adding columns with feature form open
This commit is contained in:
parent
37f53b0a6d
commit
ebfc874bfa
@ -65,6 +65,8 @@ void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDista
|
||||
connect( layer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
|
||||
connect( layer, SIGNAL( beforeCommitChanges() ), this, SLOT( editingToggled() ) );
|
||||
connect( layer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
|
||||
connect( layer, SIGNAL( attributeAdded( int ) ), this, SLOT( editingToggled() ) );
|
||||
connect( layer, SIGNAL( attributeDeleted( int ) ), this, SLOT( editingToggled() ) );
|
||||
|
||||
initLayerCache( layer );
|
||||
initModels( mapCanvas );
|
||||
@ -235,7 +237,7 @@ void QgsDualView::initModels( QgsMapCanvas* mapCanvas )
|
||||
mFeatureListModel = new QgsFeatureListModel( mFilterModel, mFilterModel );
|
||||
}
|
||||
|
||||
void QgsDualView::on_mFeatureList_currentEditSelectionChanged( const QgsFeature &feat )
|
||||
void QgsDualView::on_mFeatureList_currentEditSelectionChanged( QgsFeature &feat )
|
||||
{
|
||||
if ( !feat.isValid() )
|
||||
return;
|
||||
@ -249,6 +251,9 @@ void QgsDualView::on_mFeatureList_currentEditSelectionChanged( const QgsFeature
|
||||
mAttributeEditorLayout->removeWidget( mAttributeDialog->dialog() );
|
||||
}
|
||||
|
||||
if ( feat.attributes().count() != mLayerCache->layer()->pendingFields().count() )
|
||||
mLayerCache->featureAtId( feat.id(), feat );
|
||||
|
||||
mAttributeDialog = new QgsAttributeDialog( mLayerCache->layer(), new QgsFeature( feat ), true, mDistanceArea, this, false );
|
||||
mAttributeEditorLayout->addWidget( mAttributeDialog->dialog() );
|
||||
mAttributeDialog->dialog()->setVisible( true );
|
||||
|
@ -171,7 +171,7 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
|
||||
*
|
||||
* @param feat The newly visible feature
|
||||
*/
|
||||
void on_mFeatureList_currentEditSelectionChanged( const QgsFeature &feat );
|
||||
void on_mFeatureList_currentEditSelectionChanged( QgsFeature& feat );
|
||||
|
||||
void previewExpressionBuilder();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user