【文件属性】:
文件名称://添加第一个book元素及其子元素-QT界面设计
文件大小:13.53MB
文件格式:PPT
更新时间:2021-04-26 09:31:41
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);