[Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)
wonder.sk at gmail.com
Tue Nov 20 15:45:01 PST 2012
On Tue, Nov 20, 2012 at 6:16 PM, Etienne Tourigny
<etourigny.dev at gmail.com>wrote:
> Unfortunately the code that handles sublayer loading is in QgisApp,
> and I would like to add some tests for this in case it gets broken in
> the future. It broke a few months ago for rasters, and there ia a case
> where it doesn't work for vectors.
> Would you have a suggestion as to how we can improve this - i.e.
> manage sublayers outside of QgisApp?
I think the sublayer handling should be done at the provider level. What is
currently missing in QGIS is a notion of collection of layers. For example,
OGR has "data sources" (usually a directory, server connection etc) which
can be used for listing and accessing sublayers in a generic way - we need
something like this also for QGIS provider implementations. Some providers
already have some code going into this direction, but it's not exposed
under a common API (e.g. QgsVectorDataSource class) - there is
QgsPostgresConn or QgsSpatiaLiteConnection.
The support for data sources would be also very handy for generic
operations on layers (create, remove, rename).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer