Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. def classFactory(iface):
  2. from Plugin import TestPlugin
  3. return TestPlugin(iface)
  4.  
  5. from PyQt4.QtCore import *
  6. from PyQt4.QtGui import *
  7.  
  8. class TestPlugin:
  9. def __init__(self, iface):
  10. self.iface = iface
  11.  
  12. def initGui(self):
  13. self.action = QAction("Run", self.iface.mainWindow())
  14. QObject.connect(self.action, SIGNAL("triggered()"), self.onRun)
  15. self.iface.addPluginToMenu("Test Plugin:", self.action)
  16.  
  17. def unload (self):
  18. self.iface.removePluginMenu("Test Plugin:", self.action)
  19.  
  20. def onRun(self):
  21. QMessageBox.information(self.iface.mainWindow(), "debug", "Hello World")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement