本文整理汇总了C++中QXmlStreamAttributes::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlStreamAttributes::push_back方法的具体用法?C++ QXmlStreamAttributes::push_back怎么用?C++ QXmlStreamAttributes::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlStreamAttributes
的用法示例。
在下文中一共展示了QXmlStreamAttributes::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTabData
void SessionWriter::addTabData(const TabData& td){
m_writer.writeStartElement("Tab");
QXmlStreamAttributes attrs;
attrs.push_back(QXmlStreamAttribute("filePath", td.filePath));
attrs.push_back(QXmlStreamAttribute("cacheFilePath", td.cacheFilePath));
attrs.push_back(QXmlStreamAttribute("scrollX", QString::number(td.scrollX)));
attrs.push_back(QXmlStreamAttribute("scrollY", QString::number(td.scrollY)));
// A few attributes aren't often used, so we'll only write them into the file if they're
// set to a non-default value as to not clutter up the xml file.
if (!td.language.isEmpty())
attrs.push_back(QXmlStreamAttribute("language", td.language));
if (td.lastModified != 0)
attrs.push_back(QXmlStreamAttribute("lastModified", QString::number(td.lastModified)));
if (td.active)
attrs.push_back(QXmlStreamAttribute("active", "1"));
m_writer.writeAttributes(attrs);
m_writer.writeEndElement();
}