Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from PyQt4 import QtCore, QtGui
- from qgis.gui import QgsMessageBar
- import widget_button_dialog
- class WidgetButton(QtGui.QDialog):
- def __init__(self):
- QtGui.QDialog.__init__(self)
- # Set up the user interface from Designer.
- # After setupUI you can access any designer object by doing:
- # self.<objectname>
- self.ui = widget_button_dialog.Ui_Dialog()
- self.ui.setupUi(self)
- def openForm(self):
- self.show()
- def testSignal(self):
- iface.messageBar().pushMessage("Aviso: ",
- u"El botón ha sido clickado",
- QgsMessageBar.INFO, 5)
- self.close()
- # Create the dialog and keep reference
- reload(widget_button_dialog)
- dlg = WidgetButton()
- dlg.openForm()
- btn = dlg.ui.pushButton
- print btn.objectName()
- btn.clicked.connect(dlg.testSignal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement