首页| 论坛| 消息

标题:QDomDocument对象如何保存QFile对象到硬盘文件
作者:vachin
日期:2006-06-27 09:31
内容:

如题,偶是新手!
谁能给段代码啊,谢谢


#1 [vachin 07-20 16:06]
^_^
QString fileName("sample");
QFile xmlFile(fileName + ".xml");
if(xmlFile.open(IO_WriteOnly))
{
QTextStream xmlStream(&xmlFile);
xmlStream.setEncoding(QTextStream::UnicodeUTF8);
QDomDocumentxmlDoc;
QString strHead("version=\"1.0\" encoding=\"UTF-8\"");
xmlDoc.appendChild(svgDoc.createProcessingInstruction("xml", strHead));
xmlStream
#2 [mishuang 10-29 20:10]
svgDoc应该为xmlDoc,呵呵
#3 [cavendish 11-16 17:55]
C++ GUI Programming with Qt 3
第14章XML
Writing XML一节

回复 发表
主题 版块