Class: QgsJsonEditWidget¶
- class qgis.gui.QgsJsonEditWidget¶
Bases:
PyQt5.QtWidgets.QWidget
The
QgsJsonEditWidget
is a widget to display JSON data in a code highlighted text or tree form.Added in version 3.20.
QgsJsonEditWidget(parent: Optional[QWidget] = None) Constructor for QgsJsonEditWidget.
- Parameters:
parent –
parent widget
Enums
Bases:
enum.IntEnum
Bases:
enum.IntEnum
Methods
Returns the JSON text.
Set the visibility of controls to
visible
.Set the
formatJson
mode.Set the JSON text in the widget to
jsonText
.Set the
view
mode.
- class FormatJson(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
Format mode in the text view
Indented
: JSON data formatted with regular indentationCompact
: JSON data formatted as a compact one line stringDisabled
: JSON data is not formatted
- Compact = 1¶
- Disabled = 2¶
- Indented = 0¶
- class View(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
View mode, text or tree.
Text
: JSON data displayed as text.Tree
: JSON data displayed as tree. Tree view is disabled for invalid JSON data.
- Text = 0¶
- Tree = 1¶
- actionEvent(self, a0: QActionEvent | None)¶
- changeEvent(self, a0: QEvent | None)¶
- childEvent(self, a0: QChildEvent | None)¶
- closeEvent(self, a0: QCloseEvent | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, a0: QContextMenuEvent | None)¶
- create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, a0: QEvent | None)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, a0: QDragEnterEvent | None)¶
- dragLeaveEvent(self, a0: QDragLeaveEvent | None)¶
- dragMoveEvent(self, a0: QDragMoveEvent | None)¶
- dropEvent(self, a0: QDropEvent | None)¶
- enterEvent(self, a0: QEvent | None)¶
- event(self, a0: QEvent | None) bool ¶
- focusInEvent(self, a0: QFocusEvent | None)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, next: bool) bool ¶
- focusOutEvent(self, a0: QFocusEvent | None)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, a0: QHideEvent | None)¶
- initPainter(self, painter: QPainter | None)¶
- inputMethodEvent(self, a0: QInputMethodEvent | None)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- jsonText(self) str ¶
Returns the JSON text.
- Return type:
str
- keyPressEvent(self, a0: QKeyEvent | None)¶
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, a0: QMouseEvent | None)¶
- mouseMoveEvent(self, a0: QMouseEvent | None)¶
- mousePressEvent(self, a0: QMouseEvent | None)¶
- mouseReleaseEvent(self, a0: QMouseEvent | None)¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, a0: QPaintEvent | None)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resizeEvent(self, a0: QResizeEvent | None)¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setControlsVisible(self, visible: bool)¶
Set the visibility of controls to
visible
.- Parameters:
visible (bool)
- setFormatJsonMode(self, formatJson: QgsJsonEditWidget.FormatJson)¶
Set the
formatJson
mode.See also
FormatJson
- Parameters:
formatJson (QgsJsonEditWidget.FormatJson)
- setJsonText(self, jsonText: str | None)¶
Set the JSON text in the widget to
jsonText
.- Parameters:
jsonText (Optional[str])
- setView(self, view: QgsJsonEditWidget.View)¶
Set the
view
mode.See also
View
- Parameters:
view (QgsJsonEditWidget.View)
- showEvent(self, a0: QShowEvent | None)¶
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, a0: QTimerEvent | None)¶
- updateMicroFocus(self)¶
- wheelEvent(self, a0: QWheelEvent | None)¶