1

I installed the Customize ToolBars plugin and created a few custom toolbars. However, I saw they only get a label name instead of the actual toolbar name. I checked customization and also printed all toolbars via Python:

from PyQt4.QtGui import QToolBar

for x in iface.mainWindow().findChildren(QToolBar): 
    if x:
        print x.objectName()

This results in the following outputs. The plugins I want to find names for are showing up blank or empty.

Is there a way to just add some name to these unnamed toolbars?

output

1 Answer 1

1

When loading the stored custom toolbars, the plugin doesn't give them names, as far as I can tell it rather works with window titles. So you'd have to do it by yourself - it probably won't do no harm to the plugin.

What you have to do is to change function MyToolBars(self) in CustomToolbar.py by searching for line:

self.bar = self.iface.mainWindow().addToolBar(item.text(0))

and adding another line:

self.bar.setObjectName(item.text(0))

Maybe the author would agree to add it to his plugin, if you ask him(?)

1
  • Probably fix it in a Qgis 3 version plugin.
    – Fran Raga
    Commented Feb 14, 2017 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.