JsonTreeModel Implementation
v0.1.0
A Qt tree model for visualizing and manipulating a JSON document.
|
The JsonTreeModelWrapperNode class wraps a top-level JsonTreeModelNamedListNode, to allow its scalar members to be shown. More...
#include <jsontreemodel.h>
Public Member Functions | |
JsonTreeModelWrapperNode (JsonTreeModelNamedListNode *realNode) | |
Constructs a wrapper for realNode and takes ownership of it. More... | |
QJsonValue | value () const override |
Returns the JSON object represented by the wrapped node. More... | |
![]() | |
JsonTreeModelListNode (JsonTreeModelNode *parent) | |
Constructs an empty JsonTreeModelListNode under the specified parent. More... | |
JsonTreeModelListNode (const QJsonArray &array, JsonTreeModelNode *parent) | |
Constructs a node under the specified parent to represent the specified JSON array. More... | |
~JsonTreeModelListNode () override | |
JsonTreeModelNode * | childAt (int i) const |
Returns the child node at index i. More... | |
int | childCount () const |
Returns the number of child nodes under this row. More... | |
int | childPosition (JsonTreeModelNode *child) const |
Returns index number of the specified child, or -1 if the child does not belong to this node. More... | |
Type | type () const override |
Returns JsonTreeModelNode::Array. More... | |
![]() | |
JsonTreeModelNode (JsonTreeModelNode *parent) | |
Constructs a new node with the given parent. More... | |
virtual | ~JsonTreeModelNode () |
Frees the memory held by this node and its children. More... | |
JsonTreeModelNode * | parent () const |
Returns this node's parent. More... | |
void | setParent (JsonTreeModelNode *parent) |
Makes this node a child of parent. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { Scalar, Object, Array } |
This enum describes the type of data represented by a JsonTreeModelNode. More... | |
![]() | |
void | registerChild (JsonTreeModelNode *child) |
Puts the child node under this node's hierarchy. More... | |
void | deregisterChild (JsonTreeModelNode *child) |
Removes the child node from this node's hierarchy. More... | |
The JsonTreeModelWrapperNode class wraps a top-level JsonTreeModelNamedListNode, to allow its scalar members to be shown.
JsonTreeModelWrapperNode::JsonTreeModelWrapperNode | ( | JsonTreeModelNamedListNode * | realNode | ) |
Constructs a wrapper for realNode and takes ownership of it.
Unlike the constructors for other classes derived from JsonTreeModelNode, this one does not take a parent because JsonTreeModelWrapperNode is only meant to be used as the JsonTreeModel's root node.
|
inlineoverridevirtual |
Returns the JSON object represented by the wrapped node.
Reimplemented from JsonTreeModelListNode.