Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def classFactory(iface):
- from Plugin import TestPlugin
- return TestPlugin(iface)
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- class TestPlugin:
- def __init__(self, iface):
- self.iface = iface
- def initGui(self):
- self.action = QAction("Run", self.iface.mainWindow())
- QObject.connect(self.action, SIGNAL("triggered()"), self.onRun)
- self.iface.addPluginToMenu("Test Plugin:", self.action)
- def unload (self):
- self.iface.removePluginMenu("Test Plugin:", self.action)
- def onRun(self):
- QMessageBox.information(self.iface.mainWindow(), "debug", "Hello World")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement