JsonTreeModel Implementation  v0.1.0
A Qt tree model for visualizing and manipulating a JSON document.
JsonTreeModelWrapperNode Class Reference

The JsonTreeModelWrapperNode class wraps a top-level JsonTreeModelNamedListNode, to allow its scalar members to be shown. More...

#include <jsontreemodel.h>

Inheritance diagram for JsonTreeModelWrapperNode:
JsonTreeModelListNode JsonTreeModelNode

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...
 
- Public Member Functions inherited from JsonTreeModelListNode
 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...
 
- Public Member Functions inherited from JsonTreeModelNode
 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

- Public Types inherited from JsonTreeModelNode
enum  Type { Scalar, Object, Array }
 This enum describes the type of data represented by a JsonTreeModelNode. More...
 
- Protected Member Functions inherited from JsonTreeModelListNode
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...
 

Detailed Description

The JsonTreeModelWrapperNode class wraps a top-level JsonTreeModelNamedListNode, to allow its scalar members to be shown.

Constructor & Destructor Documentation

◆ JsonTreeModelWrapperNode()

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.

Member Function Documentation

◆ value()

QJsonValue JsonTreeModelWrapperNode::value ( ) const
inlineoverridevirtual

Returns the JSON object represented by the wrapped node.

Reimplemented from JsonTreeModelListNode.


The documentation for this class was generated from the following files: