Class: QgsMetadataWidget¶
A wizard to edit metadata on a map layer.
Class Hierarchy¶
Base classes¶
Methods
Saves the metadata to the layer. |
|
Check if values in the wizard are correct. |
|
If the CRS is updated. |
|
Returns a |
|
Returns the widget's current mode. |
|
Save all fields in a metadata object. |
|
Sets a map canvas associated with the widget. |
|
Sets the metadata to display in the widget. |
|
Sets the widget's current mode. |
|
Sets the title field for the metadata. |
|
Returns the current title field for the metadata. |
Static Methods
Returns a list of languages available by default in the wizard. |
|
Returns a list of licences available by default in the wizard. |
|
Returns a list of link types available by default in the wizard. |
|
Returns a list of MIME types available by default in the wizard. |
|
Returns a list of types available by default in the wizard. |
Signals
Emitted when the title field is changed. |
Attributes
- class qgis.gui.QgsMetadataWidget[source]¶
Bases:
QWidget
- __init__(parent: QWidget | None = None, layer: QgsMapLayer | None = None)
Constructor for the wizard.
If
layer
is set, then this constructor automatically sets the widget’smetadata()
to match the layer’s metadata..See also
- Parameters:
parent (Optional[QWidget] = None)
layer (Optional[QgsMapLayer] = None)
- LayerMetadata = 0¶
- class Mode¶
Bases:
int
- ProjectMetadata = 1¶
- checkMetadata(self) bool [source]¶
Check if values in the wizard are correct.
See also
- Return type:
bool
- metadata(self) QgsAbstractMetadataBase | None [source]¶
Returns a
QgsAbstractMetadataBase
object representing the current state of the widget.Caller takes ownership of the returned object.
See also
- Return type:
Optional[QgsAbstractMetadataBase]
- mode(self) QgsMetadataWidget.Mode [source]¶
Returns the widget’s current mode.
See also
Added in version 3.2.
- Return type:
- static parseLanguages() Dict[str, str] ¶
Returns a list of languages available by default in the wizard.
- Return type:
Dict[str, str]
- static parseLicenses() List[str] [source]¶
Returns a list of licences available by default in the wizard.
- Return type:
List[str]
- static parseLinkTypes() List[str] [source]¶
Returns a list of link types available by default in the wizard.
- Return type:
List[str]
- static parseMimeTypes() List[str] [source]¶
Returns a list of MIME types available by default in the wizard.
- Return type:
List[str]
- static parseTypes() Dict[str, str] ¶
Returns a list of types available by default in the wizard.
- Return type:
Dict[str, str]
- saveMetadata(self, metadata: QgsAbstractMetadataBase | None)[source]¶
Save all fields in a metadata object.
See also
See also
See also
- Parameters:
metadata (Optional[QgsAbstractMetadataBase])
- setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets a map
canvas
associated with the widget.- Parameters:
canvas (Optional[QgsMapCanvas])
- setMetadata(self, metadata: QgsAbstractMetadataBase | None)[source]¶
Sets the
metadata
to display in the widget.This method can be called after constructing a
QgsMetadataWidget
in order to set the displayed metadata to custom, non-layer based metadata.Calling this method will automatically
setMode()
to the correct mode corresponding to the specifiedmetadata
object.See also
- Parameters:
metadata (Optional[QgsAbstractMetadataBase])
- setMode(self, mode: QgsMetadataWidget.Mode)[source]¶
Sets the widget’s current
mode
.See also
Added in version 3.2.
- Parameters:
mode (QgsMetadataWidget.Mode)
- setTitle(self, title: str | None)[source]¶
Sets the
title
field for the metadata.See also
See also
Added in version 3.2.
- Parameters:
title (Optional[str])
- title(self) str [source]¶
Returns the current title field for the metadata.
See also
See also
Added in version 3.2.
- Return type:
str