Skip to content

Commit 34cbbde

Browse files
committedJun 18, 2015
[georef] Fix crash when closing georeferencer window while editing
GCP list item
1 parent ca78488 commit 34cbbde

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
 

‎src/plugins/georeferencer/qgsgcplistwidget.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ void QgsGCPListWidget::updateGCPList()
9595
adjustTableContent();
9696
}
9797

98+
void QgsGCPListWidget::closeEditors()
99+
{
100+
Q_FOREACH( QModelIndex index, selectedIndexes() )
101+
{
102+
closePersistentEditor( index );
103+
}
104+
}
105+
98106
void QgsGCPListWidget::itemDoubleClicked( QModelIndex index )
99107
{
100108
index = static_cast<const QSortFilterProxyModel*>( model() )->mapToSource( index );

‎src/plugins/georeferencer/qgsgcplistwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class QgsGCPListWidget : public QTableView
3838
void setGeorefTransform( QgsGeorefTransform *theGeorefTransform );
3939
QgsGCPList *gcpList() { return mGCPList; }
4040
void updateGCPList();
41+
void closeEditors();
4142

4243
public slots:
4344
// This slot is called by the list view if an item is double-clicked

‎src/plugins/georeferencer/qgsgeorefplugingui.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,10 @@ bool QgsGeorefPluginGui::equalGCPlists( const QgsGCPList &list1, const QgsGCPLis
21222122

21232123
void QgsGeorefPluginGui::clearGCPData()
21242124
{
2125+
//force all list widget editors to close before removing data points
2126+
//otherwise the editors try to update deleted data points when they close
2127+
mGCPListWidget->closeEditors();
2128+
21252129
qDeleteAll( mPoints );
21262130
mPoints.clear();
21272131
mGCPListWidget->updateGCPList();

0 commit comments

Comments
 (0)
Please sign in to comment.