[Qt-interest] Line Spacing options in Qt

Josh jnfo-c at grauman.com
Mon May 24 19:40:00 CEST 2010


Hello all,

Would anyone be interested in me posting some code to add line spacing 
options to Qt? I'll explain.

I've written briefly a couple times on my attempt to add line spacing 
options to Qt (fixed spacing, proportional, etc., as in modern word 
processors). I submitted a patch to Qt, but it was rejected as being out 
of scope. So I went back to the drawing board to figure out if it would be 
feasible to subclass QAbstractTextDocumentLayout with all the features of 
the standard text layout, plus my additional feature. I was able to strip 
the private QTextDocumentLayout class out of Qt, remove references to 
private parts of the API, and got it to compile as a separate library. I 
didn't think this would be possible, but it looks like it's working. The 
question is whether this would be of interest to anyone? If so, I'd be 
willing to clean it up a bit and put it online with some minimal 
documentation. It's a little bit of a hack as it uses -qt-user-state to 
pass in the line spacing options as I wanted to touch as little of Qt as 
possible, and this was already in QTextBlock with css support.

Let me know.

Thanks to all who help on this list, hopefully this will be of help to 
someone.

Josh



More information about the Qt-interest-old mailing list