本文整理汇总了C++中QTextListFormat::numberPrefix方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextListFormat::numberPrefix方法的具体用法?C++ QTextListFormat::numberPrefix怎么用?C++ QTextListFormat::numberPrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextListFormat
的用法示例。
在下文中一共展示了QTextListFormat::numberPrefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeListFormat
void QTextOdfWriter::writeListFormat(QXmlStreamWriter &writer, QTextListFormat format, int formatIndex) const
{
writer.writeStartElement(textNS, QString::fromLatin1("list-style"));
writer.writeAttribute(styleNS, QString::fromLatin1("name"), QString::fromLatin1("L%1").arg(formatIndex));
QTextListFormat::Style style = format.style();
if (style == QTextListFormat::ListDecimal || style == QTextListFormat::ListLowerAlpha
|| style == QTextListFormat::ListUpperAlpha
|| style == QTextListFormat::ListLowerRoman
|| style == QTextListFormat::ListUpperRoman) {
writer.writeStartElement(textNS, QString::fromLatin1("list-level-style-number"));
writer.writeAttribute(styleNS, QString::fromLatin1("num-format"), bulletChar(style));
if (format.hasProperty(QTextFormat::ListNumberSuffix))
writer.writeAttribute(styleNS, QString::fromLatin1("num-suffix"), format.numberSuffix());
else
writer.writeAttribute(styleNS, QString::fromLatin1("num-suffix"), QString::fromLatin1("."));
if (format.hasProperty(QTextFormat::ListNumberPrefix))
writer.writeAttribute(styleNS, QString::fromLatin1("num-prefix"), format.numberPrefix());
} else {
writer.writeStartElement(textNS, QString::fromLatin1("list-level-style-bullet"));
writer.writeAttribute(textNS, QString::fromLatin1("bullet-char"), bulletChar(style));
}
writer.writeAttribute(textNS, QString::fromLatin1("level"), QString::number(format.indent()));
writer.writeEmptyElement(styleNS, QString::fromLatin1("list-level-properties"));
writer.writeAttribute(foNS, QString::fromLatin1("text-align"), QString::fromLatin1("start"));
QString spacing = QString::fromLatin1("%1mm").arg(format.indent() * 8);
writer.writeAttribute(textNS, QString::fromLatin1("space-before"), spacing);
//writer.writeAttribute(textNS, QString::fromLatin1("min-label-width"), spacing);
writer.writeEndElement(); // list-level-style-*
writer.writeEndElement(); // list-style
}