Class: QgsMetadataWidget

class qgis.gui.QgsMetadataWidget

Bases: PyQt5.QtWidgets.QWidget

A wizard to edit metadata on a map layer.

New in version 3.0.

QgsMetadataWidget(parent: QWidget = None, layer: QgsMapLayer = None) 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()

Methods

acceptMetadata

Saves the metadata to the layer.

actionEvent

changeEvent

checkMetadata

Check if values in the wizard are correct.

childEvent

closeEvent

connectNotify

contextMenuEvent

create

crsChanged

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

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

metric

mode

Returns the widget’s current mode.

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

parseLanguages

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

parseLicenses

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

parseLinkTypes

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

parseMimeTypes

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

parseTypes

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

receivers

resizeEvent

saveMetadata

Save all fields in a metadata object.

sender

senderSignalIndex

setMapCanvas

Sets a map canvas associated with the widget.

setMetadata

Sets the metadata to display in the widget.

setMode

Sets the widget’s current mode.

setTitle

Sets the title field for the metadata.

sharedPainter

showEvent

tabletEvent

timerEvent

title

Returns the current title field for the metadata.

updateMicroFocus

wheelEvent

Signals

titleChanged

Emitted when the title field is changed.

Attributes

LayerMetadata

ProjectMetadata

LayerMetadata = 0
class Mode

Bases: int

ProjectMetadata = 1
acceptMetadata(self)

Saves the metadata to the layer.

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
checkMetadata(self) bool

Check if values in the wizard are correct.

See also

saveMetadata()

Return type

bool

childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
crsChanged(self)

If the CRS is updated.

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
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(self, QPaintDevice.PaintDeviceMetric) int
mode(self) QgsMetadataWidget.Mode

Returns the widget’s current mode.

See also

setMode()

New in version 3.2.

Return type

QgsMetadataWidget.Mode

mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
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(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
saveMetadata(self, metadata: QgsAbstractMetadataBase)

Save all fields in a metadata object.

See also

metadata()

See also

acceptMetadata()

See also

checkMetadata()

Parameters

metadata (QgsAbstractMetadataBase) –

sender(self) QObject
senderSignalIndex(self) int
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(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
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(self)
wheelEvent(self, QWheelEvent)