Follow up 21c81d6

This commit is contained in:
Nyall Dawson 2014-09-17 20:31:19 +10:00
parent 2b2066abb7
commit 307d4bd5a9
2 changed files with 8 additions and 8 deletions

View File

@ -3523,12 +3523,12 @@ void QgsComposer::writeWorldFile( QString worldFileName, double a, double b, dou
}
void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature * feat )
void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature& feat )
{
//update expression variables
QgsExpression::setSpecialColumn( "$atlasfeatureid", feat->id() );
QgsExpression::setSpecialColumn( "$atlasfeature", QVariant::fromValue( *feat ) );
QgsExpression::setSpecialColumn( "$atlasgeometry", QVariant::fromValue( *( feat->geometry() ) ) );
QgsExpression::setSpecialColumn( "$atlasfeatureid", feat.id() );
QgsExpression::setSpecialColumn( "$atlasfeature", QVariant::fromValue( feat ) );
QgsExpression::setSpecialColumn( "$atlasgeometry", QVariant::fromValue( *( feat.geometry() ) ) );
emit atlasPreviewFeatureChanged();
@ -3557,7 +3557,7 @@ void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature * feat )
activate();
//set current preview feature id
atlas.prepareForFeature( feat );
atlas.prepareForFeature( &feat );
emit( atlasPreviewFeatureChanged() );
}
@ -3573,7 +3573,7 @@ void QgsComposer::updateAtlasMapLayerAction( QgsVectorLayer *coverageLayer )
{
mAtlasFeatureAction = new QgsMapLayerAction( QString( tr( "Set as atlas feature for %1" ) ).arg( mTitle ), this, coverageLayer, QgsMapLayerAction::SingleFeature );
QgsMapLayerActionRegistry::instance()->addMapLayerAction( mAtlasFeatureAction );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature* ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature* ) ) );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature& ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature& ) ) );
}
}
@ -3618,7 +3618,7 @@ void QgsComposer::updateAtlasMapLayerAction( bool atlasEnabled )
QgsAtlasComposition& atlas = mComposition->atlasComposition();
mAtlasFeatureAction = new QgsMapLayerAction( QString( tr( "Set as atlas feature for %1" ) ).arg( mTitle ), this, atlas.coverageLayer(), QgsMapLayerAction::SingleFeature );
QgsMapLayerActionRegistry::instance()->addMapLayerAction( mAtlasFeatureAction );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature* ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature* ) ) );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature& ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature& ) ) );
}
}

View File

@ -620,7 +620,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Sets the specified feature as the current atlas feature
//! @note added in 2.1
void setAtlasFeature( QgsMapLayer* layer, const QgsFeature *feat );
void setAtlasFeature( QgsMapLayer* layer, const QgsFeature &feat );
//! Updates the "set as atlas feature" map layer action when atlas coverage layer changes
void updateAtlasMapLayerAction( QgsVectorLayer* coverageLayer );