[QGIS-Developer] QGis3: QgsLayerMetadata usage from QgsDataProvider to QgsMapLayer ?

Nyall Dawson nyall.dawson at gmail.com
Fri Nov 10 15:53:22 PST 2017


On 10 November 2017 at 18:15, Mark Johnson <mj10777 at googlemail.com> wrote:
> My assumption is that it a Provider would be a major source to gather the
> needed information an set QgsLayerMetadata.
> I am doing this now for the new QgsSpatiaLiteProvider.
>
> QgsDataProvider does not contain (at present) a mMetadata; member as
> QgsMapLayer does.
>
> So when setDataProvider runs in QgsVectorLayer and QgsRasterLayer, any
> Metadata gathered by a provider (in the form of QgsLayerMetadata) cannot be
> set.
>
> So the practical usage of QgsLayerMetadata is not quite complete.
>
> https://github.com/qgis/QGIS-Enhancement-Proposals/issues/91

The proper metadata storage/retrieval is not yet implemented. In
master currently there's a very limited (i.e. hack) support for
storing and loading metadata from the current project, but it's really
just a temporary measure.

See https://github.com/qgis/QGIS/pull/5379 for the first stage in real
metadata storage and retrieval. I'd see how that PR is done, and then
make your comments there.

Nyall


More information about the QGIS-Developer mailing list