[Qgis-developer] Load an editable layer as a read-only one

Martin Dobias wonder.sk at gmail.com
Thu Oct 7 17:04:52 EDT 2010


Hi Giuseppe

On Tue, Oct 5, 2010 at 1:12 AM, Giuseppe Sucameli <brush.tyler at gmail.com> wrote:
> Hi devs,
>
> there is a way to load an editable layer without editing capabilities?
> I searched for a setCapabilities() method, but nothing.
> Reducing the layer capabilities would be useful, especially for plugins,
> obviously
> without adding new capabilities.
>
> In a C++ plugin I can extend the concrete DataProvider class.
> There is a way to do the same thing in a python plugin? Maybe creating a
> wrapper
> to the layer dataProvider?

I am not aware of such functionality. But it would be possible to add
a pair of methods setReadOnly(bool) and isReadOnly() for the layers.
If set as read only, editing would be disabled.

Martin


More information about the Qgis-developer mailing list