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 --- Also there seems to be, alternative and different, 'metadata' still in place - preventing an unified way of dealing with metadata: QgsRasterDataProvider has a QString based metadata() function - virtual QString metadata() = 0; QgsVectorDataProvider has a QVariantMap metadata() function - virtual QVariantMap metadata() const { return QVariantMap(); }
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
