Hi

I'm working/investigating hwo to add WMS legend (GetLegendGraphics) in the
legend tree (QgsLegend : QTreeWidget)

**the context:
I've a WMS legend that is a pixmap because of is obtained usiging
GetLegendGraphic WMS call.
I want to show this legend as in the attached image:

https://dl.dropboxusercontent.com/u/12837459/WMSLegend.png

**problems:
as you can see in the image I'm able to display the legend pixmap, doing
setIcon for the Item (Aka QgsLegendSymbolgyItem) and setSize in QTreeWidget
(AKA QgsLegend)
In this way all the icons are set to the same Size (WRONG!)

**the QT way?:
in QT literature the solution is adding a QStyleItemDelegate or
QItemDelegate to the QTreeWidget (QgsLegend). In this delegate I can choose
how to display and size all I want overloading paint and sizeHint methods.

**The architectural problem:
The problem I found is that adding an ItemDelegate it works for all
elements displayed in the Tree, but the actual architecture of the Legend
draw it's element in different code sites... (QgsLegend has different
architecture form the Legend in Composer)

**Solutions?
There is someone that solved or approached this problem?

Thank you and see you in Brighton, Luigi Pirelli (luigi.pire...@faunalia.it)
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to