I'm trying to develop a QGIS plugin. I already created a second window. In that second window, there are several buttons that I need them to work. I can't say I'm a programmer that's why I don't really know what should I add to my main plugin code?
This is the part of the code I included in my main plugin code to show a second window:
def secondscr(self): #code the 2nd screen here self.Form = QtGui.QWidget() self.ui = Ui_Form() self.ui.setupUi(self.Form) self.Form.show() self.Form.comboBox
And then in the run def: I added this line of code
Now, I have a comboBox in my second window. I used this code in my run def:
layers = QgsProject.instance().layerTreeRoot().children() self.dlg.comboBox.clear() self.dlg.comboBox.addItems([layer.name() for layer in layers])
The problem is that my main plugin code doesn't know what is comboBox (since it only exists in my second window not in my main window).