[Qgis-developer] add form elements dynamically - qgis python plugin

Camilo Polymeris cpolymeris at gmail.com
Tue Apr 5 03:53:46 EDT 2011


I would try any of the following:

>                     self.dlg.comboBoxNew = QtGui.QComboBox()

- set the Combobox's parent to the dialog or layout:

self.dlg.comboBoxNew = QtGui.QComboBox(self.dlg)

>                     self.dlg.comboBoxNew.setObjectName("comboBox")
>                     self.dlg.comboBoxNew.setItemText(1,
> QtGui.QApplication.translate("Form", "bw", None,
> QtGui.QApplication.UnicodeUTF8))

- add the combobox to the dialog's layout after that:

self.dlg.layout().addWidget(self.dlg.comboBoxNew)

Does that help?

Regards,
Camilo


More information about the Qgis-developer mailing list