Skip to content

Commit

Permalink
Expose map theme info to export layer details
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 20, 2019
1 parent f49389d commit 5a252a3
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/core/auto_generated/layout/qgslayoutitem.sip.in
Expand Up @@ -459,6 +459,8 @@ Moves to the next export part for a multi-layered export item, during a multi-la
QString name;

QString mapLayerId;

QString mapTheme;
};

virtual QgsLayoutItem::ExportLayerDetail exportLayerDetails() const;
Expand Down
3 changes: 3 additions & 0 deletions src/core/layout/qgslayoutitem.h
Expand Up @@ -488,6 +488,9 @@ class CORE_EXPORT QgsLayoutItem : public QgsLayoutObject, public QGraphicsRectIt

//! Associated map layer ID, or an empty string if this export layer is not associated with a map layer
QString mapLayerId;

//! Associated map theme, or an empty string if this export layer does not need to be associated with a map theme
QString mapTheme;
};

/**
Expand Down
3 changes: 3 additions & 0 deletions src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -1121,6 +1121,9 @@ QgsLayoutItem::ExportLayerDetail QgsLayoutItemMap::exportLayerDetails() const
return detail;

case Layer:
if ( !mExportThemes.empty() && mExportThemeIt != mExportThemes.end() )
detail.mapTheme = *mExportThemeIt;

if ( mStagedRendererJob )
{
switch ( mStagedRendererJob->currentStage() )
Expand Down

0 comments on commit 5a252a3

Please sign in to comment.