Skip to content

Commit 663e95d

Browse files
committedApr 8, 2013
[FIX #7529] Attribute table: Crash when changing column filter
When using the field calculator and afterwards changing the column filter resulted in a crash
1 parent de2efa7 commit 663e95d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎src/app/qgsattributetabledialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
110110
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
111111
connect( mLayer, SIGNAL( layerDeleted() ), this, SLOT( close() ) );
112112
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateTitle() ) );
113+
connect( mLayer, SIGNAL( attributeAdded(int) ), this, SLOT( columnBoxInit() ) );
114+
connect( mLayer, SIGNAL( attributeDeleted(int) ), this, SLOT( columnBoxInit() ) );
113115

114116
// connect table info to window
115117
connect( mMainView, SIGNAL( filterChanged() ), this, SLOT( updateTitle() ) );
@@ -222,6 +224,7 @@ void QgsAttributeTableDialog::columnBoxInit()
222224
{
223225
mFilterColumnsMenu->removeAction( a );
224226
mFilterActionMapper->removeMappings( a );
227+
mFilterButton->removeAction( a );
225228
delete a;
226229
}
227230

@@ -348,7 +351,6 @@ void QgsAttributeTableDialog::on_mOpenFieldCalculator_clicked()
348351
if ( col >= 0 )
349352
{
350353
masterModel->reload( masterModel->index( 0, col ), masterModel->index( masterModel->rowCount() - 1, col ) );
351-
columnBoxInit();
352354
}
353355
}
354356
}

‎src/app/qgsattributetabledialog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
163163
*/
164164
void closeEvent( QCloseEvent* event );
165165

166-
private:
166+
private slots:
167167
/**
168168
* Initialize column box
169169
*/
170170
void columnBoxInit();
171171

172+
private:
172173
QMenu* mMenuActions;
173174
QAction* mActionToggleEditing;
174175

0 commit comments

Comments
 (0)
Please sign in to comment.