Hi Enrico,
Maybe add in your .ui files this snippet after the custom widgets
section:
<includes>
<include location="local">qgis.gui</include>
</includes>
Regards
Loïc
On 2017-09-29 09:43, Enrico Ferreguti wrote:
Hi Loïc,
I have no luck with your fix. I'm getting the same exception.
The uic module doesn't recognize the property
QgsMapLayerProxyModel::RasterLayer of the custom widget as valid. I
tried to remove the entire property section from .ui file and set it
programmatically during the dialog __init__ with
self.RasterLayer.setFilters(QgsMapLayerProxyModel.RasterLayer)
after setupUi but the widget does not load available layers...
Thanks anyway.
Enrico Ferreguti
2017-09-28 22:12 GMT+02:00 L.Bartoletti <lbartole...@tuxfamily.org>:
Hi,
I have found the same problem on FreeBSD if custom widgets are not
installed.
My solution at least on FreeBSD and Windows (osgeo4w) use your .ui
(it's only a XML), search this:
<customwidget>
<class>YOUR CUSTOM WIDGET</class>
<extends>YOUR CUSTOM WIDGET</extends>
<header>YOUR CUSTOM WIDGET.h</header>
</customwidget>
and change the line containing a C++ header:
<header>YOUR CUSTOM WIDGET.h</header>
by :
<header>qgis.gui</header>
Regards.
Loïc
On 28.09.2017 16:54, Enrico Ferreguti wrote:
I'm getting the following exception:
AttributeError: unknown enum QgsMapLayerProxyModel::RasterLayer
loading a plugin with QGIS custom QT designer widget in windows
standalone QGIS 2.14 ltr and 2.18.
The exception doesn't affect linux and osgeo4win installations.
I found that this was a 2015 reported issue:
https://issues.qgis.org/issues/13428 [2]
and I solve it as suggested in
https://lists.osgeo.org/pipermail/qgis-developer/2015-September/039196.html
[3] simply copying a file in the right place.
The fix is apparently easy and considering that Qt custom widgets
are widely used I can't figure why this old issue isn't yet solved.
Is it a qgis or an osgeo4win issue? Should I reopen a ticket?
Thanks. Enrico Ferreguti.
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[1]
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[1]
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer [1]
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[1]
Links:
------
[1] https://lists.osgeo.org/mailman/listinfo/qgis-developer
[2] https://issues.qgis.org/issues/13428
[3]
https://lists.osgeo.org/pipermail/qgis-developer/2015-September/039196.html
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer