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

mgri
16.4k6 gold badges48 silver badges80 bronze badges
asked Jan 17, 2017 at 14:51

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

mgri
16.4k6 gold badges48 silver badges80 bronze badges
answered Jan 17, 2017 at 16:23
1
  • Probably fix it in a Qgis 3 version plugin. Commented Feb 14, 2017 at 14:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.