[Qgis-developer] QgsRasterLayer legend interface, where is it gone ?

Martin Dobias wonder.sk at gmail.com
Sun Dec 21 06:16:27 PST 2014


On Tue, Dec 16, 2014 at 6:01 PM, Sandro Santilli <strk at keybit.net> wrote:
>
> According to documentation for the QgsRasterLayer class [1], a raster
> layer can export its legend as a pixmap using a legendPixmap() method,
> but the code doesn't not contain any such virtual method.
>
> [1] http://qgis.org/api/classQgsRasterLayer.html
>
> Instead, the class has a (non-virtual) method to retrieve a legend
> in form of a list of name/color pairs.
>
> A pure image legend is not accounted for in the raster interface
> anymore.  Still, beside the documentation, there's also a LegendUrl
> property under the "Metadata" tab of raster layer properties, which
> does not seem to be used at all either.
>

Looks like an ancient artifact in the API documentation. I would guess such
method was removed even before QGIS 1.0)


Is there a plan to allow raster layers to expose their layer again
> as an image ?
>

No. If someone wants legend image for a layer (or more of them), there is
now QgsLegendRenderer class for rendering it.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141221/7f654408/attachment-0001.html>


More information about the Qgis-developer mailing list