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.New in version 3.20.
QgsJsonEditWidget(parent: QWidget = None) Constructor for QgsJsonEditWidget.
- Parameters:
parent –
parent widget
Enums
Bases:
enum.IntEnum
Bases:
enum.IntEnum
Methods
Returns a reference to the JSON code editor used in the widget.
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)¶
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)¶
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, QActionEvent)¶
- changeEvent(self, QEvent)¶
- 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)¶
- 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 ¶
- jsonEditor(self) QgsCodeEditorJson ¶
Returns a reference to the JSON code editor used in the widget.
New in version 3.36.
- Return type:
- jsonText(self) str ¶
Returns the JSON text.
- Return type:
str
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- 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)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- 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)¶
Set the JSON text in the widget to
jsonText
.- Parameters:
jsonText (str) –
- setView(self, view: QgsJsonEditWidget.View)¶
Set the
view
mode.See also
View
- Parameters:
view (QgsJsonEditWidget.View) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶