Skip to content
Permalink
Browse files

Follow up 21c81d6

  • Loading branch information
nyalldawson committed Sep 17, 2014
1 parent 2b2066a commit 307d4bd5a94f38a580efac833e8f636f6af789b5
Showing with 8 additions and 8 deletions.
  1. +7 −7 src/app/composer/qgscomposer.cpp
  2. +1 −1 src/app/composer/qgscomposer.h
@@ -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& ) ) );
}
}

@@ -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 );

0 comments on commit 307d4bd

Please sign in to comment.
You can’t perform that action at this time.