[Qgis-developer] QgsRasterLayer legend interface, where is it gone ?
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 , 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.
>  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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer