Skip to content

Commit 9eb8ef4

Browse files
author
Hugo Mercier
committedMar 18, 2014
Add signals to atlas generation
1 parent 0a78102 commit 9eb8ef4

File tree

7 files changed

+23
-0
lines changed

7 files changed

+23
-0
lines changed
 

‎python/core/composer/qgsatlascomposition.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,9 @@ public:
122122
/**Is emitted when the coverage layer for an atlas changes*/
123123
void coverageLayerChanged( QgsVectorLayer* layer );
124124

125+
/**Is emitted when atlas rendering has begun*/
126+
void renderBegun();
127+
128+
/**Is emitted when atlas rendering has ended*/
129+
void renderEnded();
125130
};

‎python/core/composer/qgscomposermap.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ class QgsComposerMap : QgsComposerItem
407407
/**Is emitted on rotation change to notify north arrow pictures*/
408408
void mapRotationChanged( double newRotation );
409409

410+
/**Is emitted when the map has been prepared for atlas rendering, just before actual rendering*/
411+
void preparedForAtlas();
412+
410413
public slots:
411414

412415
/**Called if map canvas has changed*/

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ bool QgsAtlasComposition::beginRender()
266266
return false;
267267
}
268268

269+
emit renderBegun();
270+
269271
bool featuresUpdated = updateFeatures();
270272
if ( !featuresUpdated )
271273
{
@@ -296,6 +298,8 @@ void QgsAtlasComposition::endRender()
296298
}
297299

298300
updateAtlasMaps();
301+
302+
emit renderEnded();
299303
}
300304

301305
void QgsAtlasComposition::updateAtlasMaps()

‎src/core/composer/qgsatlascomposition.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
150150
/**Is emitted when the coverage layer for an atlas changes*/
151151
void coverageLayerChanged( QgsVectorLayer* layer );
152152

153+
/**Is emitted when atlas rendering has begun*/
154+
void renderBegun();
155+
156+
/**Is emitted when atlas rendering has ended*/
157+
void renderEnded();
158+
153159
private:
154160
/**Updates the filename expression*/
155161
void updateFilenameExpression();

‎src/core/composer/qgscomposermap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ void QgsComposerMap::setNewAtlasFeatureExtent( const QgsRectangle& extent )
641641

642642
mAtlasFeatureExtent = newExtent;
643643
mCacheUpdated = false;
644+
emit preparedForAtlas();
644645
updateItem();
645646
emit itemChanged();
646647
emit extentChanged();

‎src/core/composer/qgscomposermap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
445445
/**Is emitted on rotation change to notify north arrow pictures*/
446446
void mapRotationChanged( double newRotation );
447447

448+
/**Is emitted when the map has been prepared for atlas rendering, just before actual rendering*/
449+
void preparedForAtlas();
450+
448451
public slots:
449452

450453
/**Called if map canvas has changed*/

‎src/core/composer/qgscomposition.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,7 @@ bool QgsComposition::setAtlasMode( QgsComposition::AtlasMode mode )
25372537
if ( ! atlasHasFeatures )
25382538
{
25392539
mAtlasMode = QgsComposition::AtlasOff;
2540+
mAtlasComposition.endRender();
25402541
return false;
25412542
}
25422543
}

0 commit comments

Comments
 (0)