Class: QgsMetadataWidget

class qgis.gui.QgsMetadataWidget(parent: QWidget = None, layer: QgsMapLayer = None)

Bases: PyQt5.QtWidgets.QWidget

Constructor for the wizard.

If layer is set, then this constructor automatically sets the widget’s metadata() to match the layer’s metadata..

See also

setMetadata()

A wizard to edit metadata on a map layer.

New in version 3.0.

Parameters
  • parent (QWidget = None) –

  • layer

LayerMetadata = 0
class Mode

Bases: int

ProjectMetadata = 1
acceptMetadata(self)

Saves the metadata to the layer.

actionEvent()
changeEvent()
checkMetadata(self) → bool

Check if values in the wizard are correct.

See also

saveMetadata()

Return type

bool

childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
crsChanged(self)

If the CRS is updated.

customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metadata(self) → QgsAbstractMetadataBase

Returns a QgsAbstractMetadataBase object representing the current state of the widget.

Caller takes ownership of the returned object.

See also

saveMetadata()

Return type

QgsAbstractMetadataBase

metric()
mode(self) → QgsMetadataWidget.Mode

Returns the widget’s current mode.

See also

setMode()

New in version 3.2.

Return type

QgsMetadataWidget.Mode

mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
parseLanguages() → Dict[str, str]

Returns a list of languages available by default in the wizard.

Return type

Dict[str, str]

parseLicenses() → List[str]

Returns a list of licences available by default in the wizard.

Return type

List[str]

parseLinkTypes() → List[str]

Returns a list of link types available by default in the wizard.

See also

https()

Return type

List[str]

parseMimeTypes() → List[str]

Returns a list of MIME types available by default in the wizard.

See also

https()

Return type

List[str]

parseTypes() → Dict[str, str]

Returns a list of types available by default in the wizard.

Return type

Dict[str, str]

receivers()
resizeEvent()
saveMetadata(self, metadata: QgsAbstractMetadataBase)

Save all fields in a metadata object.

See also

metadata()

See also

acceptMetadata()

See also

checkMetadata()

Parameters

metadata (QgsAbstractMetadataBase) –

sender()
senderSignalIndex()
setMapCanvas(self, canvas: QgsMapCanvas)

Sets a map canvas associated with the widget.

Parameters

canvas (QgsMapCanvas) –

setMetadata(self, metadata: QgsAbstractMetadataBase)

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 specified metadata object.

See also

metadata()

Parameters

metadata (QgsAbstractMetadataBase) –

setMode(self, mode: QgsMetadataWidget.Mode)

Sets the widget’s current mode.

See also

mode()

New in version 3.2.

Parameters

mode (QgsMetadataWidget.Mode) –

setTitle(self, title: str)

Sets the title field for the metadata.

See also

title()

See also

titleChanged()

New in version 3.2.

Parameters

title (str) –

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
title(self) → str

Returns the current title field for the metadata.

See also

setTitle()

See also

titleChanged()

New in version 3.2.

Return type

str

titleChanged

Emitted when the title field is changed.

See also

title()

See also

setTitle()

New in version 3.2: [signal]

Parameters

title (str) –

updateMicroFocus()
wheelEvent()