Skip to content
Permalink
Browse files
Show preview for "$area" in expr builder, make preview consistent wit…
…h result

Another partial fix for #9060
  • Loading branch information
wonder-sk committed Feb 20, 2014
1 parent 4d74ad7 commit d92a0e622e08a6fceb24e4f2fdab81961a1a8004
Showing with 7 additions and 1 deletion.
  1. +6 −0 src/app/qgsfieldcalculator.cpp
  2. +1 −1 src/gui/qgsexpressionbuilderwidget.cpp
@@ -43,6 +43,12 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl )

connect( builder, SIGNAL( expressionParsed( bool ) ), this, SLOT( setOkButtonState() ) );

QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
builder->setGeomCalculator( myDa );

//default values for field width and precision
mOutputFieldWidthSpinBox->setValue( 10 );
mOutputFieldPrecisionSpinBox->setValue( 3 );
@@ -317,7 +317,7 @@ void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()

if ( !mFeature.isValid() )
{
mLayer->getFeatures( QgsFeatureRequest().setFlags(( mLayer->geometryType() != QGis::NoGeometry && exp.needsGeometry() ) ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) ).nextFeature( mFeature );
mLayer->getFeatures().nextFeature( mFeature );
}

if ( mFeature.isValid() )

0 comments on commit d92a0e6

Please sign in to comment.