With PyQGIS, you can change various settings such as making the groups in the Layers Panel (or table of contents) bold:
from PyQt4.QtCore import QSettings QSettings().setValue("/Qgis/legendGroupsBold", True)
The settings are written which can be seen from the options or from typing:
QSettings().value("/Qgis/legendGroupsBold") >>> u'true'
But it does not get applied. I thought using
might help but unfortunately not. The only way for it to apply would be to either go to the GUI (
Settings > Options) then click OK or restart QGIS.
Is there a method to doing this through PyQGIS?
I want to add this as a macro in a project file to ensure (for aesthetic purposes) that only group names are bold and layer names are not. Therefore, it would be ideal if the QSettings are applied when the project has loaded (the initial settings would be reapplied when the project closed).