Class: QgsMetadataWidget¶
A wizard to edit metadata on a map layer.
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsMetadataWidget[source]¶
Bases:
QWidget- __init__(parent: QWidget | None = None, layer: QgsMapLayer | None = None)
Constructor for the wizard.
If
layeris 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
QgsAbstractMetadataBaseobject 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
canvasassociated with the widget.- Parameters:
canvas (Optional[QgsMapCanvas])
- setMetadata(self, metadata: QgsAbstractMetadataBase | None)[source]¶
Sets the
metadatato display in the widget.This method can be called after constructing a
QgsMetadataWidgetin 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 specifiedmetadataobject.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
titlefield 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
- signal titleChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.