3

I have made a QGIS plugin (Python) and when I hover my mouse/cursor over the icon in QGIS the name of the plugin seem to be "Plugins Toolbar". I have searched all .py scripts in the directory of the plugin and can't find any reference to "Plugins Toolbar".

How do I change the name of this "icon text"?

See picture

5

In your plugin.py file (or whatever you named the main file), look inside the initGui() function. You'll want to change the text parameter for the icon::

def initGui(self):
"""Create the menu entries and toolbar icons inside the QGIS GUI."""

icon_path = ':/plugins/example/icon.png'
self.add_action(
    icon_path,
    text=self.tr(u'Plugin_button'),
    callback=self.run,
    parent=self.iface.mainWindow())
  • 1
    You are quick, I was writing the same answer :). Just I want to add that the OP should reload the plugin using the Plugin Reloader to see the changes. – ahmadhanb Jan 25 at 10:55
  • 1
    @ahmadhanb - I had my coffee :). Thank you for your tip, the plugin should indeed be reloaded such as with the Plugin Reloader... plugin. – Joseph Jan 25 at 10:59
  • 2
    @SunTour Please accept the answer if it solved your problem. – ahmadhanb Jan 25 at 11:13
  • How do i "accept" the answer? I am a bit new here.. – SunTour Jan 26 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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