0

I am working on a plugin which should generate various atlas views based on some parameter. After choosing some variables, the LayoutDesigner should be opened with all the predefined options - this works fine. However, I could not find out, how the "PriviewAtlas" button is toggled with python. So when the Designer starts it should be already activated.

Any ideas?

enter image description here

1 Answer 1

3

You can catch when a QgsLayoutDesignerInterface is opened and if there is a coverage layer, you know you can enable atlas preview

def whenOpenedDesignerInterface(designer):
    if designer.layout().atlas().coverageLayer() is not None:
        designer.setAtlasPreviewEnabled(True)

iface.layoutDesignerOpened.connect(whenOpenedDesignerInterface)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.