diff options
Diffstat (limited to 'doc/html/outliner-example.html')
-rw-r--r-- | doc/html/outliner-example.html | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/doc/html/outliner-example.html b/doc/html/outliner-example.html index 3c1ffe283..ec2f895d9 100644 --- a/doc/html/outliner-example.html +++ b/doc/html/outliner-example.html @@ -113,7 +113,7 @@ traverse it. #define OUTLINETREE_H #include <<a href="qlistview-h.html">ntqlistview.h</a>> -#include <<a href="qdom-h.html">ntqdom.h</a>> +#include <<a href="tqdom-h.html">tqdom.h</a>> class OutlineTree : public <a href="ntqlistview.html">TQListView</a> { @@ -124,9 +124,9 @@ public: ~OutlineTree(); private: - <a href="qdomdocument.html">TQDomDocument</a> domTree; - void getHeaderInformation( const <a href="qdomelement.html">TQDomElement</a> &header ); - void buildTree( <a href="qlistviewitem.html">TQListViewItem</a> *parentItem, const <a href="qdomelement.html">TQDomElement</a> &parentElement ); + <a href="tqdomdocument.html">TQDomDocument</a> domTree; + void getHeaderInformation( const <a href="tqdomelement.html">TQDomElement</a> &header ); + void buildTree( <a href="qlistviewitem.html">TQListViewItem</a> *parentItem, const <a href="tqdomelement.html">TQDomElement</a> &parentElement ); }; #endif // OUTLINETREE_H @@ -174,26 +174,26 @@ private: opmlFile.<a href="ntqfile.html#close">close</a>(); // get the header information from the DOM - <a href="qdomelement.html">TQDomElement</a> root = domTree.documentElement(); - <a href="qdomnode.html">TQDomNode</a> node; -<a name="x1907"></a> node = root.<a href="qdomnode.html#firstChild">firstChild</a>(); -<a name="x1909"></a> while ( !node.<a href="qdomnode.html#isNull">isNull</a>() ) { -<a name="x1911"></a><a name="x1908"></a> if ( node.<a href="qdomnode.html#isElement">isElement</a>() && node.<a href="qdomnode.html#nodeName">nodeName</a>() == "head" ) { -<a name="x1913"></a> <a href="qdomelement.html">TQDomElement</a> header = node.<a href="qdomnode.html#toElement">toElement</a>(); + <a href="tqdomelement.html">TQDomElement</a> root = domTree.documentElement(); + <a href="tqdomnode.html">TQDomNode</a> node; +<a name="x1907"></a> node = root.<a href="tqdomnode.html#firstChild">firstChild</a>(); +<a name="x1909"></a> while ( !node.<a href="tqdomnode.html#isNull">isNull</a>() ) { +<a name="x1911"></a><a name="x1908"></a> if ( node.<a href="tqdomnode.html#isElement">isElement</a>() && node.<a href="tqdomnode.html#nodeName">nodeName</a>() == "head" ) { +<a name="x1913"></a> <a href="tqdomelement.html">TQDomElement</a> header = node.<a href="tqdomnode.html#toElement">toElement</a>(); getHeaderInformation( header ); break; } -<a name="x1910"></a> node = node.<a href="qdomnode.html#nextSibling">nextSibling</a>(); +<a name="x1910"></a> node = node.<a href="tqdomnode.html#nextSibling">nextSibling</a>(); } // create the tree view out of the DOM - node = root.<a href="qdomnode.html#firstChild">firstChild</a>(); - while ( !node.<a href="qdomnode.html#isNull">isNull</a>() ) { - if ( node.<a href="qdomnode.html#isElement">isElement</a>() && node.<a href="qdomnode.html#nodeName">nodeName</a>() == "body" ) { - <a href="qdomelement.html">TQDomElement</a> body = node.<a href="qdomnode.html#toElement">toElement</a>(); + node = root.<a href="tqdomnode.html#firstChild">firstChild</a>(); + while ( !node.<a href="tqdomnode.html#isNull">isNull</a>() ) { + if ( node.<a href="tqdomnode.html#isElement">isElement</a>() && node.<a href="tqdomnode.html#nodeName">nodeName</a>() == "body" ) { + <a href="tqdomelement.html">TQDomElement</a> body = node.<a href="tqdomnode.html#toElement">toElement</a>(); buildTree( 0, body ); break; } - node = node.<a href="qdomnode.html#nextSibling">nextSibling</a>(); + node = node.<a href="tqdomnode.html#nextSibling">nextSibling</a>(); } } @@ -201,41 +201,41 @@ OutlineTree::~OutlineTree() { } -void <a name="f523"></a>OutlineTree::getHeaderInformation( const <a href="qdomelement.html">TQDomElement</a> &header ) +void <a name="f523"></a>OutlineTree::getHeaderInformation( const <a href="tqdomelement.html">TQDomElement</a> &header ) { // visit all children of the header element and look if you can make // something with it - <a href="qdomnode.html">TQDomNode</a> node = header.<a href="qdomnode.html#firstChild">firstChild</a>(); - while ( !node.<a href="qdomnode.html#isNull">isNull</a>() ) { - if ( node.<a href="qdomnode.html#isElement">isElement</a>() ) { + <a href="tqdomnode.html">TQDomNode</a> node = header.<a href="tqdomnode.html#firstChild">firstChild</a>(); + while ( !node.<a href="tqdomnode.html#isNull">isNull</a>() ) { + if ( node.<a href="tqdomnode.html#isElement">isElement</a>() ) { // case for the different header entries - if ( node.<a href="qdomnode.html#nodeName">nodeName</a>() == "title" ) { - <a href="qdomtext.html">TQDomText</a> textChild = node.<a href="qdomnode.html#firstChild">firstChild</a>().toText(); - if ( !textChild.<a href="qdomnode.html#isNull">isNull</a>() ) { -<a name="x1912"></a> <a href="ntqlistview.html#setColumnText">setColumnText</a>( 0, textChild.<a href="qdomnode.html#nodeValue">nodeValue</a>() ); + if ( node.<a href="tqdomnode.html#nodeName">nodeName</a>() == "title" ) { + <a href="tqdomtext.html">TQDomText</a> textChild = node.<a href="tqdomnode.html#firstChild">firstChild</a>().toText(); + if ( !textChild.<a href="tqdomnode.html#isNull">isNull</a>() ) { +<a name="x1912"></a> <a href="ntqlistview.html#setColumnText">setColumnText</a>( 0, textChild.<a href="tqdomnode.html#nodeValue">nodeValue</a>() ); } } } - node = node.<a href="qdomnode.html#nextSibling">nextSibling</a>(); + node = node.<a href="tqdomnode.html#nextSibling">nextSibling</a>(); } } -void <a name="f524"></a>OutlineTree::buildTree( <a href="qlistviewitem.html">TQListViewItem</a> *parentItem, const <a href="qdomelement.html">TQDomElement</a> &parentElement ) +void <a name="f524"></a>OutlineTree::buildTree( <a href="qlistviewitem.html">TQListViewItem</a> *parentItem, const <a href="tqdomelement.html">TQDomElement</a> &parentElement ) { <a href="qlistviewitem.html">TQListViewItem</a> *thisItem = 0; - <a href="qdomnode.html">TQDomNode</a> node = parentElement.<a href="qdomnode.html#firstChild">firstChild</a>(); - while ( !node.<a href="qdomnode.html#isNull">isNull</a>() ) { - if ( node.<a href="qdomnode.html#isElement">isElement</a>() && node.<a href="qdomnode.html#nodeName">nodeName</a>() == "outline" ) { + <a href="tqdomnode.html">TQDomNode</a> node = parentElement.<a href="tqdomnode.html#firstChild">firstChild</a>(); + while ( !node.<a href="tqdomnode.html#isNull">isNull</a>() ) { + if ( node.<a href="tqdomnode.html#isElement">isElement</a>() && node.<a href="tqdomnode.html#nodeName">nodeName</a>() == "outline" ) { // add a new list view item for the outline if ( parentItem == 0 ) thisItem = new <a href="qlistviewitem.html">TQListViewItem</a>( this, thisItem ); else thisItem = new <a href="qlistviewitem.html">TQListViewItem</a>( parentItem, thisItem ); -<a name="x1916"></a> thisItem-><a href="qlistviewitem.html#setText">setText</a>( 0, node.<a href="qdomnode.html#toElement">toElement</a>().attribute( "text" ) ); +<a name="x1916"></a> thisItem-><a href="qlistviewitem.html#setText">setText</a>( 0, node.<a href="tqdomnode.html#toElement">toElement</a>().attribute( "text" ) ); // recursive build of the tree - buildTree( thisItem, node.<a href="qdomnode.html#toElement">toElement</a>() ); + buildTree( thisItem, node.<a href="tqdomnode.html#toElement">toElement</a>() ); } - node = node.<a href="qdomnode.html#nextSibling">nextSibling</a>(); + node = node.<a href="tqdomnode.html#nextSibling">nextSibling</a>(); } } </pre> |