QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
The QgsJsonEditWidget is a widget to display JSON data in a code highlighted text or tree form. More...
#include <qgsjsoneditwidget.h>
Public Types | |
enum class | FormatJson : int { Indented = 0 , Compact = 1 , Disabled = 2 } |
Format mode in the text view. More... | |
enum class | View : int { Text = 0 , Tree = 1 } |
View mode, text or tree. More... | |
Public Member Functions | |
QgsJsonEditWidget (QWidget *parent=nullptr) | |
Constructor for QgsJsonEditWidget. | |
QgsCodeEditorJson * | jsonEditor () |
Returns a reference to the JSON code editor used in the widget. | |
QString | jsonText () const |
Returns the JSON text. | |
void | setControlsVisible (bool visible) |
Set the visibility of controls to visible. | |
void | setFormatJsonMode (FormatJson formatJson) |
Set the formatJson mode. | |
void | setJsonText (const QString &jsonText) |
Set the JSON text in the widget to jsonText. | |
void | setView (View view) const |
Set the view mode. | |
The QgsJsonEditWidget is a widget to display JSON data in a code highlighted text or tree form.
Definition at line 31 of file qgsjsoneditwidget.h.
|
strong |
Format mode in the text view.
Enumerator | |
---|---|
Indented | JSON data formatted with regular indentation. |
Compact | JSON data formatted as a compact one line string. |
Disabled | JSON data is not formatted. |
Definition at line 45 of file qgsjsoneditwidget.h.
|
strong |
View mode, text or tree.
Enumerator | |
---|---|
Text | JSON data displayed as text. |
Tree | JSON data displayed as tree. Tree view is disabled for invalid JSON data. |
Definition at line 38 of file qgsjsoneditwidget.h.
|
explicit |
Constructor for QgsJsonEditWidget.
parent | parent widget |
Definition at line 28 of file qgsjsoneditwidget.cpp.
QgsCodeEditorJson * QgsJsonEditWidget::jsonEditor | ( | ) |
Returns a reference to the JSON code editor used in the widget.
Definition at line 62 of file qgsjsoneditwidget.cpp.
QString QgsJsonEditWidget::jsonText | ( | ) | const |
Returns the JSON text.
Definition at line 99 of file qgsjsoneditwidget.cpp.
void QgsJsonEditWidget::setControlsVisible | ( | bool | visible | ) |
Set the visibility of controls to visible.
Definition at line 130 of file qgsjsoneditwidget.cpp.
void QgsJsonEditWidget::setFormatJsonMode | ( | QgsJsonEditWidget::FormatJson | formatJson | ) |
void QgsJsonEditWidget::setJsonText | ( | const QString & | jsonText | ) |
Set the JSON text in the widget to jsonText.
Definition at line 67 of file qgsjsoneditwidget.cpp.
void QgsJsonEditWidget::setView | ( | QgsJsonEditWidget::View | view | ) | const |