QgsRenderContext QgsLayoutUtils::createRenderContextForLayout( QgsLayout *layout, QPainter *painter, double dpi ) { QgsLayoutItemMap *referenceMap = layout ? layout->referenceMap() : nullptr; QgsRenderContext context = createRenderContextForMap( referenceMap, painter, dpi ); if ( layout ) context.setFlags( layout->context().renderContextFlags() ); return context; }
QgsRenderContext QgsComposerUtils::createRenderContextForComposition( QgsComposition* composition, QPainter* painter ) { QgsComposerMap* referenceMap = composition ? composition->referenceMap() : nullptr; return createRenderContextForMap( referenceMap, painter ); }