Class: QgsMetadataWidget¶
- class qgis.gui.QgsMetadataWidget¶
Bases:
PyQt5.QtWidgets.QWidget
A wizard to edit metadata on a map layer.
QgsMetadataWidget(parent: QWidget = None, layer:
QgsMapLayer
= 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
Methods
Saves the metadata to the layer.
Check if values in the wizard are correct.
If the CRS is updated.
Returns a
QgsAbstractMetadataBase
object representing the current state of the widget.Returns the widget's current mode.
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.
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.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- 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
- Return type:
bool
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.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
- Return type:
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mode(self) QgsMetadataWidget.Mode ¶
Returns the widget’s current mode.
See also
Added in version 3.2.
- Return type:
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.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
See also
See also
- 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 specifiedmetadata
object.See also
- Parameters:
metadata (QgsAbstractMetadataBase)
- setMode(self, mode: QgsMetadataWidget.Mode)¶
Sets the widget’s current
mode
.See also
Added in version 3.2.
- Parameters:
mode (QgsMetadataWidget.Mode)
- setTitle(self, title: str)¶
Sets the
title
field for the metadata.See also
See also
Added in version 3.2.
- Parameters:
title (str)
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- title(self) str ¶
Returns the current title field for the metadata.
See also
See also
Added in version 3.2.
- Return type:
str
- titleChanged¶
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.
- Parameters:
name (str = ...)
revision (int = ...)
arguments (Sequence = ...)
- Return type:
PYQT_SIGNAL
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶