Class: QgsProjectMetadata¶
- class qgis.core.QgsProjectMetadata¶
Bases:
QgsAbstractMetadataBase
Constructor for QgsProjectMetadata.
QgsProjectMetadata(
QgsProjectMetadata
)A structured metadata store for a map layer.
QgsProjectMetadata
handles storage and management of the metadata for aQgsProject
. This class is an internal QGIS format with a common metadata structure, which allows for code to access the metadata properties for projects in a uniform way.The metadata store is designed to be compatible with the Dublin Core metadata specifications, and will be expanded to allow compatibility with ISO specifications in future releases. However, the QGIS internal schema does not represent a superset of all existing metadata schemas and accordingly conversion from specific metadata formats to
QgsProjectMetadata
may result in a loss of information.This class is designed to follow the specifications detailed in the schema definition available at resources/qgis-project-metadata.xsd within the QGIS source code.
Metadata can be validated through the use of QgsLayerMetadataValidator subclasses. E.g. validating against the native QGIS metadata schema can be performed using QgsNativeProjectMetadataValidator.
New in version 3.2:
Methods
Returns the project author string.
- rtype
QgsProjectMetadata
Returns the project's creation date/timestamp.
Tests whether the common metadata fields in this object are equal to
other
.- param metadataElement
Sets the project
author
stringSets the project's creation date/timestamp.
- param metadataElement
- author(self) str ¶
Returns the project author string.
See also
- Return type
str
- clone(self) QgsProjectMetadata ¶
- Return type
- creationDateTime(self) QDateTime ¶
Returns the project’s creation date/timestamp.
See also
- Return type
QDateTime
- equals(self, other: QgsAbstractMetadataBase) bool ¶
Tests whether the common metadata fields in this object are equal to
other
.Subclasses should utilize this method from their equality operators to test equality of base class members.
New in version 3.2.
- readMetadataXml(self, metadataElement: QDomElement) bool ¶
- Parameters
metadataElement (QDomElement) –
- Return type
bool
- setAuthor(self, author: str)¶
Sets the project
author
stringSee also
- Parameters
author (str) –
- setCreationDateTime(self, creationDateTime: Union[QDateTime, datetime.datetime])¶
Sets the project’s creation date/timestamp.
See also
- Parameters
creationDateTime (Union[QDateTime) –
- writeMetadataXml(self, metadataElement: QDomElement, document: QDomDocument) bool ¶
- Parameters
metadataElement (QDomElement) –
document (QDomDocument) –
- Return type
bool