raze
raze

Reputation: 702

qplaintextedit line spacing

Is it possible to edit the spacing/margin between each line in a qplaintextedit?

I have tried editing the stylesheet using normal html/css tags (line-height), but it doesn't seem to make a difference.

Upvotes: 5

Views: 3873

Answers (1)

Bill
Bill

Reputation: 11822

A co-worker of mine tried to solve a similar problem a few days ago with Qt 4.7.4. What he found is that we could set line spacing with class QTextBlockFormat:

Line spacing is set with setLineHeight() and retrieved via lineHeight() and lineHeightType(). The types of line spacing available are in the LineHeightTypes enum.

Unfortunately this functionality was introduced in Qt 4.8.

So you can set line spacing if it is possible for you to use Qt 4.8, QTextBlockFormat, QTextDocument and QTextEdit instead of QPlainTextEdit.

Upvotes: 5

Related Questions