Good day to all, I am trying to create my first QGIS 3 plugin, I am using Plugin Builder and Qt Designer, I want to add a variable named name with lineEdit to be able to use the information entered later, however, I receive the following error:
name = self.dlg.lineEdit.text()
AttributeError: 'Etiquetas_layout' object has no attribute 'dlg'
here's my code:
def run(self): """Run method that performs all the real work""" name = self.dlg.lineEdit.text() # Create the dialog with elements (after translation) and keep reference # Only create GUI ONCE in callback, so that it will only load when the plugin is started if self.first_start == True: self.first_start = False self.dlg = Etiquetas_layoutDialog() # 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