Skip to content
Permalink
Browse files

[georef] Fix crash when closing georeferencer window while editing

GCP list item
  • Loading branch information
nyalldawson committed Jun 18, 2015
1 parent ca78488 commit 34cbbde21884adfc176d0ee0a36dbcf6f01401cf
@@ -95,6 +95,14 @@ void QgsGCPListWidget::updateGCPList()
adjustTableContent();
}

void QgsGCPListWidget::closeEditors()
{
Q_FOREACH( QModelIndex index, selectedIndexes() )
{
closePersistentEditor( index );
}
}

void QgsGCPListWidget::itemDoubleClicked( QModelIndex index )
{
index = static_cast<const QSortFilterProxyModel*>( model() )->mapToSource( index );
@@ -38,6 +38,7 @@ class QgsGCPListWidget : public QTableView
void setGeorefTransform( QgsGeorefTransform *theGeorefTransform );
QgsGCPList *gcpList() { return mGCPList; }
void updateGCPList();
void closeEditors();

public slots:
// This slot is called by the list view if an item is double-clicked
@@ -2122,6 +2122,10 @@ bool QgsGeorefPluginGui::equalGCPlists( const QgsGCPList &list1, const QgsGCPLis

void QgsGeorefPluginGui::clearGCPData()
{
//force all list widget editors to close before removing data points
//otherwise the editors try to update deleted data points when they close
mGCPListWidget->closeEditors();

qDeleteAll( mPoints );
mPoints.clear();
mGCPListWidget->updateGCPList();

0 comments on commit 34cbbde

Please sign in to comment.
You can’t perform that action at this time.