@@ -157,7 +157,6 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
157
157
mAttributeViewButton ->setIcon ( QgsApplication::getThemeIcon ( " /mActionPropertyItem.png" ) );
158
158
mExpressionSelectButton ->setIcon ( QgsApplication::getThemeIcon ( " /mIconExpressionSelect.svg" ) );
159
159
mAddFeature ->setIcon ( QgsApplication::getThemeIcon ( " /mActionNewTableRow.png" ) );
160
- mOpenExpressionWidget ->setIcon ( QgsApplication::getThemeIcon ( " /mIconExpression.svg" ) );
161
160
162
161
// toggle editing
163
162
bool canChangeAttributes = mLayer ->dataProvider ()->capabilities () & QgsVectorDataProvider::ChangeAttributeValues;
@@ -205,14 +204,16 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
205
204
mFieldModel = new QgsFieldModel ();
206
205
mFieldModel ->setLayer ( mLayer );
207
206
mFieldCombo ->setModel ( mFieldModel );
208
- connect ( mOpenExpressionWidget , SIGNAL ( clicked () ), this , SLOT ( openExpressionBuilder () ) );
209
207
connect ( mRunFieldCalc , SIGNAL ( clicked () ), this , SLOT ( updateFieldFromExpression () ) );
210
208
connect ( mUpdateExpressionText , SIGNAL ( returnPressed () ), this , SLOT ( updateFieldFromExpression () ) );
209
+ mUpdateExpressionText ->setLayer ( mLayer );
210
+ mUpdateExpressionText ->setLeftHandButtonStyle ( true );
211
211
editingToggled ();
212
212
}
213
213
214
214
QgsAttributeTableDialog::~QgsAttributeTableDialog ()
215
215
{
216
+ delete myDa;
216
217
}
217
218
218
219
void QgsAttributeTableDialog::updateTitle ()
@@ -302,7 +303,8 @@ void QgsAttributeTableDialog::updateFieldFromExpression()
302
303
bool calculationSuccess = true ;
303
304
QString error;
304
305
305
- QgsExpression exp ( mUpdateExpressionText ->text () );
306
+
307
+ QgsExpression exp ( mUpdateExpressionText ->currentField () );
306
308
exp .setGeomCalculator ( *myDa );
307
309
bool useGeometry = exp .needsGeometry ();
308
310
@@ -364,15 +366,6 @@ void QgsAttributeTableDialog::updateFieldFromExpression()
364
366
mLayer ->endEditCommand ();
365
367
}
366
368
367
- void QgsAttributeTableDialog::openExpressionBuilder ()
368
- {
369
- QgsExpressionBuilderDialog dlg ( mLayer , mUpdateExpressionText ->text (), this );
370
- if ( dlg.exec () )
371
- {
372
- mUpdateExpressionText ->setText ( dlg.expressionText () );
373
- }
374
- }
375
-
376
369
void QgsAttributeTableDialog::filterColumnChanged ( QObject* filterAction )
377
370
{
378
371
mFilterButton ->setDefaultAction ( qobject_cast<QAction *>( filterAction ) );
0 commit comments