I have a problem when I add a second Toolbar Button and Dialog to a QGIS plugin, I load my plugin in "Manage an installing plugins..." but this error appears

enter image description here

This is a part of my .py

enter image description here

What is the problem?

I use this link: How can I add a second Toolbar Button and Dialog to a QGIS plugin built with Plugin Builder?

closed as off-topic by user2856, PolyGeo Sep 19 '18 at 4:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Please add error messages and your code as text to your question. – Kadir Şahbaz Sep 18 '18 at 21:01

You should add from PyQt4.QtCore import QObject to import section of your .py file.

NameError: global name '***' is not defined means roughly that you use an object you have not defined yet. So you have to define an object (like a = 1. a is an int object here) or you have to import that object which exists somewhere.

  • You should also add ... from PyQt4.QtCore import SIGNAL – Gonzalo Gomez Sep 19 '18 at 23:43

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