【文件属性】:
文件名称://添加第一个book元素及其子元素-Qt简介包含Qt的系统的架构
文件大小:14.45MB
文件格式:PPT
更新时间:2021-04-24 03:05:37
qt教程
//添加第一个book元素及其子元素
QDomElement book = doc.createElement(tr(“图书”));
QDomAttr id = doc.createAttribute(tr(“编号”));
QDomElement title = doc.createElement(tr(“书名”));
QDomElement author = doc.createElement(tr(“作者”));
QDomText text;
id.setValue(tr(“1″));
book.setAttributeNode(id);
text = doc.createTextNode(tr(“Qt”));
title.appendChild(text);
text = doc.createTextNode(tr(“shiming”));
author.appendChild(text);
book.appendChild(title);
book.appendChild(author);
root.appendChild(book);