[Qgis-user] Programmatically close a layout dialog

Nyall Dawson nyall.dawson at gmail.com
Tue May 22 20:39:41 PDT 2018


On 22 May 2018 at 23:54, DelazJ <delazj at gmail.com> wrote:
> Hi,
>
> From the Python Console, how can I close a print layout dialog, knowing its
> name?

In 3.0 something like this will work:

designers = [d for d in iface.openLayoutDesigners() if
d.masterLayout().name() == 'Layout 1']
if designers:
    designers[0].close()

Nyall



>
> Thanks for any hint,
> Harrissou
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



More information about the Qgis-user mailing list