diff options
Diffstat (limited to 'examples/demos/documentviewer/doc/jsonviewer.py.rstinc')
-rw-r--r-- | examples/demos/documentviewer/doc/jsonviewer.py.rstinc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/demos/documentviewer/doc/jsonviewer.py.rstinc b/examples/demos/documentviewer/doc/jsonviewer.py.rstinc new file mode 100644 index 000000000..1ba92f247 --- /dev/null +++ b/examples/demos/documentviewer/doc/jsonviewer.py.rstinc @@ -0,0 +1,11 @@ +``JsonViewer`` displays a JSON file in a ``QTreeView``. Internally, it loads +the contents of a file into a data structure via a string and uses it to +populate a custom tree model with JsonItemModel. + +The JSON viewer demonstrates how to implement a custom item model +inherited from ``QAbstractItemModel``. + +``JsonViewer`` uses the top-level objects of the document as bookmarks for +navigation. Other nodes (keys and values) can be added as additional bookmarks, +or removed from the bookmark list. A ``QLineEdit`` is used as a search field to +navigate through the JSON tree. |