[Qgis-developer] Load an editable layer as a read-only one
brush.tyler at gmail.com
Thu Oct 28 13:32:31 EDT 2010
I filled a ticket  and attached a patch to fix it too ;)
On Mon, Oct 25, 2010 at 4:00 PM, Giuseppe Sucameli <brush.tyler at gmail.com>wrote:
> Hi Martin,
> sorry for this reply so late.
> On Thu, Oct 7, 2010 at 11:04 PM, Martin Dobias <wonder.sk at gmail.com>wrote:
>> Hi Giuseppe
>> On Tue, Oct 5, 2010 at 1:12 AM, Giuseppe Sucameli <brush.tyler at gmail.com>
>> > 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.
> I think this would be a nice feature for pyplugins developers.
> In this moment the only workaround to make a layer uneditable is creating a
> plugin window containing a new canvas, then adding the layer in this new
> but you can neither use useful tools (e.g all the newest selection tools)
> or qgis
> mainwindow capabilities (add layers, move layers, ...).
> I'm going to open a ticket on trac.
> Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer