вот мой код:
Код: Выделить всё
import sys,os import win32api from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * import ctypes from PyQt4 import uic
class HelloWorld:
def __init__(self, iface):
self.iface = iface
self.canvas = iface.mapCanvas()
self.connect(self.ui.pushButton,QtCore.SIGNAL("clicked()"),self.function)
def initGui(self):
self.action = QAction(QIcon(":/plugins/"), "&HelloWorld", self.iface.mainWindow())
self.action.setWhatsThis("Configuration for test plugin")
self.action.setStatusTip("This is status tip")
QObject.connect(self.action, SIGNAL("activated()"), self.hello_world)
self.iface.addPluginToMenu("HelloWorld", self.action)
def unload(self):
self.iface.removePluginMenu("HelloWorld",self.action)
self.iface.removeToolBarIcon(self.action)
def function( self ):
QMessageBox.information(self.iface.mainWindow(), QCoreApplication.translate('HelloWorld', "HelloWorld"), QCoreApplication.translate('HelloWorld', "HelloWorld"))
def hello_world(self):
path = os.path.dirname( os.path.abspath( __file__ ) )
self.optionsDialog = uic.loadUi(os.path.join(path,"untitled.ui"))
if name == "main": pass