I'm using the plugin builder to develop a plugin QGIS. I want the fields of the selected layer in combobox_1
to appear in combobox_5
and fields of the selected layer in comboBox_2
to appear in comboBox_3
and comboBox_4
.
I am new to python and PyQGIS. I do not have the methods defined in initGUI
. How can I achieve this?
def initGui(self):
"""Create the menu entries and toolbar icons inside the QGIS GUI."""
icon_path = ':/plugins/TheWorkflow/icon.png'
self.add_action(
icon_path,
text=self.tr(u'The Workflow'),
callback=self.run,
parent=self.iface.mainWindow())
def unload(self):
"""Removes the plugin menu item and icon from QGIS GUI."""
for action in self.actions:
self.iface.removePluginVectorMenu(
self.tr(u'&The Workflow'),
action)
self.iface.removeToolBarIcon(action)
# remove the toolbar
del self.toolbar
def run(self):
"""Run method that performs all the real work"""
# show the dialog
self.dlg.show()
# Run the dialog event loop
result = self.dlg.exec_()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
# substitute with your code.
pass
def run(self):
function in your mainPlugin.py file?