[QGIS-Developer] Programmaticaly open the Log Panel

Richard Duivenvoorde rdmailings at duif.net
Mon Feb 25 13:49:31 PST 2019


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?)?


More information about the QGIS-Developer mailing list