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

JsonTreeModelScalarNode is the most basic element of a JsonTreeModel's internal data. More...

#include <jsontreemodel.h>

Inheritance diagram for JsonTreeModelScalarNode:
JsonTreeModelNode

Public Member Functions

 JsonTreeModelScalarNode (const QJsonValue &value, JsonTreeModelNode *parent)
 Constructs a node under the specified parent to represent the specified scalar value. More...
 
QJsonValue value () const override
 Returns the scalar JSON value represented by this node. More...
 
void setValue (const QJsonValue &value)
 Replaces the value represented by this node. More...
 
Type type () const override
 Returns JsonTreeModelNode::Scalar. 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...
 
JsonTreeModelNodeparent () 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...
 

Detailed Description

JsonTreeModelScalarNode is the most basic element of a JsonTreeModel's internal data.

It represents a single scalar JSON value (nulls, Booleans, numbers, and strings).

Note
JsonTreeModelScalarNode cannot be the parent of another node.

Constructor & Destructor Documentation

◆ JsonTreeModelScalarNode()

JsonTreeModelScalarNode::JsonTreeModelScalarNode ( const QJsonValue &  value,
JsonTreeModelNode parent 
)

Constructs a node under the specified parent to represent the specified scalar value.

Member Function Documentation

◆ setValue()

void JsonTreeModelScalarNode::setValue ( const QJsonValue &  value)
inline

Replaces the value represented by this node.

See also
value()

◆ type()

Type JsonTreeModelScalarNode::type ( ) const
inlineoverridevirtual

◆ value()

QJsonValue JsonTreeModelScalarNode::value ( ) const
inlineoverridevirtual

Returns the scalar JSON value represented by this node.

See also
setValue()

Implements JsonTreeModelNode.


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