<div dir="ltr">This was discussed earlier on the list <a href="http://osgeo-org.1560.x6.nabble.com/Compiling-ui-files-with-custom-widgets-creates-wrong-imports-td5218684.html">http://osgeo-org.1560.x6.nabble.com/Compiling-ui-files-with-custom-widgets-creates-wrong-imports-td5218684.html</a><div>Here's the bug report <a href="http://hub.qgis.org/issues/13428">http://hub.qgis.org/issues/13428</a></div><div><br>This happens because PyQt is not aware of qgis_customwidgets.py located in qgis\python\PyQt4\uic\widget-plugins folder.</div><div><br></div><div><br></div><div>-Lauri</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 16, 2015 at 12:05 PM, enricofer <span dir="ltr"><<a href="mailto:enricofer@gmail.com" target="_blank">enricofer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>I got a similar issue using QgsFieldExpressionWidget.<br></div>After compiling ui with pyuic4 I found that the import statement at the end of the compiled .py was wrong. So I manually changed it to:<br></div></div>from qgis.gui import QgsFieldExpressionWidget<br><br></div>Regards<br><br></div>Enrico Ferreguti<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2015-11-16 10:30 GMT+01:00 Alexander Bruy [via OSGeo.org] <span dir="ltr"><<a href="http:///user/SendEmail.jtp?type=node&node=5236568&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span>:<br></div></div><blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><div><div class="h5"><div><div>

        Hi all,
<br><br>I use QGIS custom widgets in my plugin, namely QgsMaplayerComboBox.
<br>When I run QGIS under Linux all works fine, but under Windows I got Python
<br>error on startup related to missed enum entries:
<br><br>   File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\__init__.py",
<br>line 210, in loadUiType
<br>    winfo = compiler.UICompiler().compileUi(uifile, code_string,
<br>from_imports, resource_suffix)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\Compiler\compiler.py",
<br>line 139, in compileUi
<br>    w = self.parse(input_stream, resource_suffix)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 992, in parse
<br>    actor(elem)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 818, in createUserInterface
<br>    self.traverseWidgetTree(elem)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 796, in traverseWidgetTree
<br>    handler(self, child)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 507, in createLayout
<br>    self.traverseWidgetTree(elem)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 796, in traverseWidgetTree
<br>    handler(self, child)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 550, in handleItem
<br>    self.traverseWidgetTree(elem)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 796, in traverseWidgetTree
<br>    handler(self, child)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 258, in createWidget
<br>    self.stack.push(self.setupObject(widget_class, parent, elem))
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\uiparser.py",
<br>line 220, in setupObject
<br>    self.wprops.setProperties(obj, branch)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
<br>line 418, in setProperties
<br>    prop_value = self.convert(prop, widget)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
<br>line 383, in convert
<br>    return func(prop[0], **args)
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
<br>line 116, in _set
<br>    expr = [self._pyEnumMember(v) for v in prop.text.split('|')]
<br>  File "C:\OSGeo4W\apps\Python27\lib\site-packages\PyQt4\uic\properties.py",
<br>line 111, in _pyEnumMember
<br>    raise AttributeError("unknown enum %s" % cpp_name)
<br>AttributeError: unknown enum QgsMapLayerProxyModel::RasterLayer
<br><br>I use QGIS LTR installed via OSGeo4W installer. Same problem also exists
<br>with dev and release versions. Any ideas what is wrong and how to fix this?
<br><br>Thanks
<br>-- 
<br>Alexander Bruy
<br>_______________________________________________
<br>Qgis-developer mailing list
<br></div></div></div></div><a href="http:///user/SendEmail.jtp?type=node&node=5236556&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><span class=""><span>List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="nofollow" link="external" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="nofollow" link="external" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>

        
        
        
        <br>
        <br>
        </span></span><hr color="#cccccc" noshade size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://osgeo-org.1560.x6.nabble.com/Problem-with-using-QGIS-custom-widgets-in-plugin-tp5236556.html" rel="nofollow" link="external" target="_blank">http://osgeo-org.1560.x6.nabble.com/Problem-with-using-QGIS-custom-widgets-in-plugin-tp5236556.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Quantum GIS - Developer, <a rel="nofollow" link="external">click here</a>.<br>
                <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></blockquote></div><br></div>


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Problem-with-using-QGIS-custom-widgets-in-plugin-tp5236556p5236568.html" target="_blank">Re: Problem with using QGIS custom widgets in plugin</a><br>
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-Developer-f4099106.html" target="_blank">Quantum GIS - Developer mailing list archive</a> at Nabble.com.<br><br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br></blockquote></div><br></div>