Cutelee  6.1.0
Public Member Functions | List of all members
Cutelee::NodeList Class Reference

A list of Nodes with some convenience API for rendering them. More...

#include <cutelee/node.h>

Inheritance diagram for Cutelee::NodeList:
Inheritance graph
[legend]

Public Member Functions

 NodeList ()
 
 NodeList (const NodeList &list)
 
 NodeList (const QList< Cutelee::Node * > &list)
 
 ~NodeList ()
 
void append (const QList< Cutelee::Node * > &nodeList)
 
void append (Cutelee::Node *node)
 
bool containsNonText () const
 
template<typename T >
QList< T > findChildren ()
 
NodeListoperator= (const NodeList &list)
 
void render (OutputStream *stream, Context *c) const
 

Detailed Description

Typically, tags which have an end tag will create and later render a list of child nodes.

This class contains API such as append and render to make creating such list easily.

The findChildren method behaves similarly to the QObject::findChildren method, returning a list of nodes of a particular type from the Node objects contained in the list (and their children).

See also
Tags with end tags

Definition at line 147 of file node.h.

Constructor & Destructor Documentation

◆ NodeList() [1/3]

NodeList::NodeList ( )

Creates an empty NodeList.

Definition at line 119 of file node.cpp.

◆ NodeList() [2/3]

NodeList::NodeList ( const NodeList list)

Copy constructor.

Definition at line 121 of file node.cpp.

◆ NodeList() [3/3]

NodeList::NodeList ( const QList< Cutelee::Node * > &  list)

Convenience constructor

Definition at line 134 of file node.cpp.

◆ ~NodeList()

NodeList::~NodeList ( )

Destructor.

Definition at line 147 of file node.cpp.

Member Function Documentation

◆ append() [1/2]

void NodeList::append ( const QList< Cutelee::Node * > &  nodeList)

Appends nodeList to the end of this NodeList.

Definition at line 160 of file node.cpp.

◆ append() [2/2]

void NodeList::append ( Cutelee::Node node)

Appends node to the end of this NodeList.

Definition at line 149 of file node.cpp.

◆ containsNonText()

bool NodeList::containsNonText ( ) const

Returns true if this NodeList contains non-text nodes.

Definition at line 175 of file node.cpp.

◆ findChildren()

template<typename T >
QList<T> Cutelee::NodeList::findChildren ( )
inline

A recursive listing of nodes in this tree of type T.

Definition at line 190 of file node.h.

◆ render()

void NodeList::render ( OutputStream stream,
Context c 
) const