[QGIS-Developer] open atlas layout, using python

Raymond Nijssen r.nijssen at terglobo.nl
Thu Oct 11 07:51:40 PDT 2018


Hi Nyall,

It sounded great and I spent some hours on that better approach, but I 
didn't succeed. So maybe 3.6 will have it...

Tnx!
Raymond


On 25-09-18 23:57, Nyall Dawson wrote:
> On Tue, 25 Sep 2018 at 22:36, Raymond Nijssen <r.nijssen at terglobo.nl> wrote:
>>
>> 1. Can I open a layout window with a python command?
> 
> designer = iface.openLayoutDesigner( layout )
> 
>> 2. Can I turn on "atlas preview" with a python command?
> 
> You'd have to do some fragile code to do this. Basically:
> 
> - get designer window from designer.view()'s parent window
> - find the mActionAtlasPreview child action in the window
> - manually toggle it on
> 
> This should work, but isn't stable API - so is likely to break ;)
> 
> A better approach is to (quickly, before 3.4 final!) file a PR
> exposing the toggle atlas preview behavior to
> QgsLayoutDesignerInterface. Then you'll be able to just do:
> 
> designer = iface.openLayoutDesigner( layout )
> designer.toggleAtlasPreview( True )
> 
> Nyall
> 
> 
> Hope anyone knows!
>>
>> Kind regards,
>> Raymond
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

-- 
Terglobo
Fahrenheitstraat 1
5223 BJ 's-Hertogenbosch
The Netherlands
+31 (0) 6 25 31 49 83


More information about the QGIS-Developer mailing list