Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from PyQt5 import QtCore, QtGui, QtWidgets
- from qgis.gui import QgsMessageBar
- import importlib
- import widget_button_dialog
- class WidgetButton(QtWidgets.QDialog):
- def __init__(self):
- QtWidgets.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 boton ha sido clickado",
- Qgis.Info, 5)
- self.close()
- # Create the dialog and keep reference
- importlib.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