28 setWindowTitle( QString(
"Select by expression - %1" ).arg( layer->
name() ) );
35 mButtonSelect->addAction( mActionSelect );
36 mButtonSelect->addAction( mActionAddToSelection );
37 mButtonSelect->addAction( mActionRemoveFromSelection );
38 mButtonSelect->addAction( mActionSelectInstersect );
39 mButtonSelect->setDefaultAction( mActionSelect );
41 mExpressionBuilder->setLayer( layer );
42 mExpressionBuilder->setExpressionText( startText );
43 mExpressionBuilder->loadFieldNames();
44 mExpressionBuilder->loadRecent(
"Selection" );
47 restoreGeometry( settings.value(
"/Windows/ExpressionSelectionDialog/geometry" ).toByteArray() );
52 return mExpressionBuilder;
57 mExpressionBuilder->setExpressionText( text );
62 return mExpressionBuilder->expressionText();
68 mExpressionBuilder->setGeomCalculator( da );
85 if ( expression->
evaluate( &feat, fields ).toBool() )
87 newSelection << feat.
id();
113 if ( expression->
evaluate( &feat, fields ).toBool() )
115 newSelection << feat.
id();
145 if ( expression->
evaluate( &feat, fields ).toBool() )
147 newSelection << feat.
id();
182 if ( expression->
evaluate( &feat, fields ).toBool() )
184 newSelection.remove( feat.
id() );
207 settings.setValue(
"/Windows/ExpressionSelectionDialog/geometry", saveGeometry() );
221 void QgsExpressionSelectionDialog::saveRecent()
223 mExpressionBuilder->saveToRecent(
"Selection" );