[QGIS-Developer] Programmaticaly open the Log Panel

Tejas L tejvan at live.com
Tue Feb 26 00:06:26 PST 2019


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?)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190226/cef3c3cb/attachment-0001.html>


More information about the QGIS-Developer mailing list