[Qgis-developer] Problem with using QGIS custom widgets in plugin

Alexander Bruy alexander.bruy at gmail.com
Mon Nov 16 01:38:58 PST 2015


Hi all,

I use QGIS custom widgets in my plugin, namely QgsMaplayerComboBox.
When I run QGIS under Linux all works fine, but under Windows I got Python
error on startup related to missed enum entries:

   File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\__init__.py",
line 210, in loadUiType
    winfo = compiler.UICompiler().compileUi(uifile, code_string,
from_imports, resource_suffix)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\Compiler\compiler.py",
line 139, in compileUi
    w = self.parse(input_stream, resource_suffix)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 992, in parse
    actor(elem)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 818, in createUserInterface
    self.traverseWidgetTree(elem)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 796, in traverseWidgetTree
    handler(self, child)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 507, in createLayout
    self.traverseWidgetTree(elem)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 796, in traverseWidgetTree
    handler(self, child)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 550, in handleItem
    self.traverseWidgetTree(elem)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 796, in traverseWidgetTree
    handler(self, child)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 258, in createWidget
    self.stack.push(self.setupObject(widget_class, parent, elem))
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
line 220, in setupObject
    self.wprops.setProperties(obj, branch)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
line 418, in setProperties
    prop_value = self.convert(prop, widget)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
line 383, in convert
    return func(prop[0], **args)
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
line 116, in _set
    expr = [self._pyEnumMember(v) for v in prop.text.split('|')]
  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
line 111, in _pyEnumMember
    raise AttributeError("unknown enum %s" % cpp_name)
AttributeError: unknown enum QgsMapLayerProxyModel::RasterLayer

I use QGIS LTR installed via OSGeo4W installer. Same problem also exists
with dev and release versions. Any ideas what is wrong and how to fix this?

Thanks
-- 
Alexander Bruy


More information about the Qgis-developer mailing list