[Qgis-user] Programmatically close a layout dialog
DelazJ
delazj at gmail.com
Thu May 24 09:31:16 PDT 2018
Hi Nyall,
Thanks a lot. I've been playing (for a long moment) with masterLayout and
openLayoutDesigner, trying different combinations but I just overlooked the
plural form. Works like a charm.
Harrissou
2018-05-23 5:39 GMT+02:00 Nyall Dawson <nyall.dawson at gmail.com>:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180524/3f014f32/attachment.html>
More information about the Qgis-user
mailing list