예제 #1
0
static int count( const QList<BasicElement*>& list )
{
    BasicElement* element;
    int counter = list.count();
    foreach ( element, list )
        counter += count( element->childElements() );

    return counter;
}
예제 #2
0
static QString dumpRecurse(const QList<BasicElement*>& list)
{
    BasicElement *element;
    QString       result = "[ ";

    if (list.count() > 0) {
        result.append(QString::number(list.count()));
        result.append(' ');

        foreach ( element, list )
            result.append(dumpRecurse(element->childElements()));
    }
    return result + " ]";
}