Debugging Global name ''QgsMapLayerComboBox' is not defined?

by icelandico   Last Updated January 13, 2018 23:22 PM

I try to develop little plugin for Qgis. I used custom widgets in QT that comes with QGIS 2.18 and loaded QgisMapLayerComboBox. But when I reload my plugin in QGis it gives me an error:

2018-01-14T00:06:10 1 Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 342, in startPlugin plugins[packageName].initGui() File "C:/Users/Michal.DESKTOP-M9QN5BH/.qgis2/python/plugins\DMS2Point\DMS2Point.py", line 172, in initGui parent=self.iface.mainWindow()) File "C:/Users/Michal.DESKTOP-M9QN5BH/.qgis2/python/plugins\DMS2Point\DMS2Point.py", line 139, in add_action self.dlg = DMS2PointDialog() File "C:/Users/Michal.DESKTOP-M9QN5BH/.qgis2/python/plugins\DMS2Point\DMS2Point_dialog.py", line 30, in init self.setupUi(self) File "C:/Users/Michal.DESKTOP-M9QN5BH/.qgis2/python/plugins\DMS2Point\DMS2Point_dialog_base.py", line 48, in setupUi self.mMapLayerComboBox_2 = QgsMapLayerComboBox(self.widget) NameError: global name 'QgsMapLayerComboBox' is not defined

I don't understand the last line. Code is compiled and everything, step by step made according to tutorials 'How to make a Qgis plugin...'. This error does no appear when I use 'normal' QT ComboBoxes. I wanted to use Qgis Custom Widgets because they might be easier in use and modification.



Related Questions



How to fill multi combo box in pyqgis?

Updated August 14, 2017 03:22 AM


Adding attribute list to combobox in QGIS plugin?

Updated July 31, 2017 22:22 PM