[Qgis-developer] QgsLegendInterface binding updates, or QgsLegend overhaul?

Martin Dobias wonder.sk at gmail.com
Fri Dec 7 12:35:21 PST 2012


Hi Larry

On Wed, Nov 28, 2012 at 9:11 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:
>
> Hi,
>
> I added to QgsLegendInterface today [0] and noticed how lacking the
> Python binding is when working with the legend, compared to the number
> of methods that could be exposed from QgsLegend. Looks like
> QgsLegendInterface really hasn't been updated since QGIS 1.5.
>
> Users/plugin devs have asked for better means of working with the
> legend, so my questions are:
>
> * Should there be an effort to bring many of the reasonable-to-expose
> methods from QgsLegend to QgsLegendInterface for 2.0 release?
>
> * OR, should QgsLegend be overhauled first (as there has been talk about)?

If you have time for QgsLegend overhaul, please go ahead! QgsLegend
has been stuck in application source code... but it is easy to see
that developers would really appreciate its availability in GUI
library. Once in GUI library, we could get rid of the
QgsLegendInterface class that is clumsy and very limited. Right now
there are two issues why QgsLegend is not inside GUI library:
1. it has some dependencies on QgisApp (e.g. open layer properties,
open attribute table) - those dependencies should relatively easy to
solve (by adding support for custom context menu actions)
2. it is implemented as a QTreeWidget + QTreeWidgetItem. This is
should be ideally replaced by model/view approach that separates the
data and view logic.

Regards
Martin


More information about the Qgis-developer mailing list