本文整理汇总了C++中QTextFrameFormat::property方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextFrameFormat::property方法的具体用法?C++ QTextFrameFormat::property怎么用?C++ QTextFrameFormat::property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextFrameFormat
的用法示例。
在下文中一共展示了QTextFrameFormat::property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unapplyStyle
void KoSectionStyle::unapplyStyle(QTextFrame §ion) const
{
if (d->parentStyle)
d->parentStyle->unapplyStyle(section);
QTextFrameFormat format = section.frameFormat();
QList<int> keys = d->stylesPrivate.keys();
for (int i = 0; i < keys.count(); i++) {
QVariant variant = d->stylesPrivate.value(keys[i]);
if (variant == format.property(keys[i]))
format.clearProperty(keys[i]);
}
section.setFrameFormat(format);
}
示例2: frameToString
//.........这里部分代码省略.........
if ( blockFormat.isValid() ) {
QTextList *list = block.textList();
if ( list ) {
QTextListFormat f = list->format();
out += " liststyle=\"";
switch( f.style() ) {
default:
case QTextListFormat::ListDisc:
out += "disc";
break;
case QTextListFormat::ListDecimal:
out += "decimal";
break;
}
out += "\"";
out += " listindent=\"" + QString::number( f.indent() ) + "\"";
} else {
if ( blockFormat.indent() != 0 ) {
out += " blockindent=\"" + QString::number( blockFormat.indent() ) +
"\"";
}
}
}
out += ">\n";
QTextBlock::iterator it2;
for( it2 = block.begin(); it2 != block.end(); ++it2 ) {
QTextFragment fragment = it2.fragment();
if ( !fragment.isValid() ) continue;
QString text = fragment.text();
QString outText;
for( int i = 0; i < text.size(); ++i ) {
if ( text.at( i ) == 0xfffc ) {
outText += "<todo status=\"";
QTextImageFormat imageFormat = fragment.charFormat().toImageFormat();
if ( imageFormat.isValid() ) {
if ( imageFormat.name().contains( "done" ) ) outText += "done";
else outText += "todo";
} else {
dbg() << "NO IMAGE FORMAT" << endl;
}
outText += "\"/>";
} else {
outText += escape( QString( text.at( i ) ) );
}
}
out += " <fragment";
QTextCharFormat format = fragment.charFormat();
if ( !format.anchorHref().isEmpty() ) {
out += " link=\"" + escape( format.anchorHref() ) + "\"";
}
if ( format.fontWeight() == QFont::Bold ) {
out += " bold=\"true\"";
}
if ( format.fontItalic() ) {
out += " italic=\"true\"";
}
if ( format.hasProperty( QTextFormat::FontPointSize ) &&
format.fontPointSize() != 10 ) {
out += " fontsize=\"" + QString::number( format.fontPointSize() ) +
"\"";
}
if ( outText.trimmed().isEmpty() ) outText.replace( " ", "[FIXME:space]" );
out += ">" + outText + "</fragment>\n";
}
out += "</block>";
out += "\n";
}
QTextFrame *f = it.currentFrame();
if ( f ) {
QTextFrameFormat format = f->frameFormat();
out += "<frame";
if ( format.hasProperty( TextFormats::FrameType ) ) {
out += " type=";
if ( format.property( TextFormats::FrameType ) == TextFormats::CodeFrame ) {
out += "\"code\"";
} else {
out += "\"undefined\"";
}
}
out += ">\n";
out += frameToString( f );
out += "</frame>\n";
}
}
return out;
}