[QGIS-Developer] Programmaticaly open the Log Panel

Thomas Gratier osgeo.mailinglist at gmail.com
Fri Mar 1 21:45:36 PST 2019


Hi,

Richard, the following works although restricted to opening the MessageLog
panel

    iface.openMessageLog()


Thomas

Le mar. 26 févr. 2019 à 09:06, Tejas L <tejvan at live.com> a écrit :

> Hi Richard,
>
> That worked perfectly, thanks!
>
> When developing plugins I always find myself opening the Log window and
> the Python console, after I start up QGIS. It would be nice to have a way
> to save the panel layout. At the moment though, your code snippet is
> sufficient for my needs.
>
> Regards,
> Tej
>
> ------------------------------
> *From:* Richard Duivenvoorde <rdmailings at duif.net>
> *Sent:* Tuesday, February 26, 2019 3:19 AM
> *To:* qgis-developer at lists.osgeo.org
> *Cc:* tejvan at live.com
> *Subject:* Re: [QGIS-Developer] Programmaticaly open the Log Panel
>
> On 25/02/2019 09.57, Tejas L wrote:
> > Hello team,
> >
> > I would like to automatically open the Log Panel whenever Qgis starts.
> > Is there a way to do this?
>
> Hi,
>
> For what I know there is no api call for it directly, but you can search
> for child widgets in the main panel, something like this:
>
> for widget in iface.mainWindow().children():
>     if widget.objectName() == 'MessageLog':
>         widget.show()
>
> Or shorter (but trickier):
>
> iface.mainWindow().findChild(QDockWidget, 'MessageLog').show()
>
> With me this pops up the Messagelog Panel (though then you do not have
> your tab yet, but that is a child of that one probably...)
>
> Regards,
>
> Richard Duivenvoorde
>
> Ps what do you want to use it for, because more people see the use of it
> maybe we can just add it (or ask to be added?)?
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190302/0c08f9dd/attachment.html>


More information about the QGIS-Developer mailing list