QGraphicsTextItem 字間距:this
void QFont::setLetterSpacing ( SpacingType type, qreal spacing )spa
行間距,請參考這斷代碼:code
Copy code
for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
{
tc.setPosition(it.position(),QTextCursor::MoveAnchor);
QTextBlockFormat bfmt = it.blockFormat();
bfmt.setBottomMargin(mlinespacing);
tc.setBlockFormat(bfmt);
this->setTextCursor(tc);
}orm
主要是應用 QTextBlock 的 setBottomMargin 這個功能。ci