• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Cpper
            C/C++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
            #include <Qt/QFile.h>
            #include 
            <Qt/QDom.h>
            #include 
            <iostream>

            void showNodeInfo(const QDomNode& node)
            {
                std::cout
            <<"node name:"<<node.nodeName().toStdString()<<std::endl;
                QDomNode subnode 
            = node.firstChild();
                std::cout
            <<" node id:"<<subnode.nodeName().toStdString()<<std::endl;
                std::cout
            <<" node id value:"<<subnode.toElement().text().toStdString()<<std::endl;
                subnode 
            = subnode.nextSibling();
                std::cout
            <<" node name:"<<subnode.nodeName().toStdString()<<std::endl;
                std::cout
            <<" node name value:"<<subnode.toElement().text().toStdString()<<std::endl;
                subnode 
            = subnode.nextSibling();
                std::cout
            <<" node prefix:"<<subnode.nodeName().toStdString()<<std::endl;
                std::cout
            <<" node prefix value:"<<subnode.toElement().text().toStdString()<<std::endl;
            }

            int main(int argc, char *argv[])
            {
                QDomDocument doc;
                QFile xmlfile(
            "config.xml");
                
            if(!xmlfile.open(QIODevice::ReadOnly))return false;
                
            if(doc.setContent(&xmlfile))
                {
                    QDomElement root 
            = doc.documentElement();
                    QDomNode node 
            = root.firstChild();
                    
            for(;node.isNull()!=true;node=node.nextSibling())
                        showNodeInfo(node);
                }
                system(
            "pause");
                
            return 1;
            }

            基本步驟:
            1.使用QFile載入文件
            2.給QDomDocument設置文件內容
            3.從QDomDocument獲取文檔根節點
            4.遍歷節點并作處理
            posted on 2012-01-15 21:25 ccsdu2009 閱讀(1341) 評論(0)  編輯 收藏 引用
             
            久久精品国产亚洲欧美| 久久综合久久自在自线精品自| 久久精品国产秦先生| 久久国产精品免费一区| 久久综合亚洲色一区二区三区| 国产精品久久久久国产A级| 武侠古典久久婷婷狼人伊人| 亚洲人成电影网站久久| 97精品伊人久久久大香线蕉| 久久久久国产成人精品亚洲午夜| 国内精品久久久久久久97牛牛| 久久久久久A亚洲欧洲AV冫| 丁香狠狠色婷婷久久综合| 久久久艹| 精品多毛少妇人妻AV免费久久| 久久er99热精品一区二区| 久久精品国产99久久香蕉| 国产亚洲美女精品久久久久狼| 国内精品久久久久影院薰衣草| 久久久久成人精品无码| 国产产无码乱码精品久久鸭 | 国产精品成人精品久久久| 久久免费看黄a级毛片| 欧美久久久久久午夜精品| 久久99国产精品99久久| 久久久久久久波多野结衣高潮| 久久精品国产只有精品66| 久久九九亚洲精品| 久久线看观看精品香蕉国产| 久久久无码精品亚洲日韩按摩| 亚洲第一极品精品无码久久| 久久99热这里只有精品国产| 青春久久| 性欧美大战久久久久久久久| 伊人色综合久久天天人守人婷| 国内精品久久久久影院亚洲| 久久九九久精品国产| 久久涩综合| 久久综合亚洲鲁鲁五月天| 久久久久人妻精品一区 | 99久久精品费精品国产|