PDA

View Full Version : Column width sensitive kerning in QTableView



Debilski
21st October 2009, 14:46
Hi,
in tables on OS X there is some kerning property which automatically scales a bit, when the width of the column gets small enough. This can also be seen in the Finder for example. When you resize the column the text gets a bit narrower at first before the ellipsis dots appear.
Is this possible to emulate in Qt also or will I have do inherit from dedicated Cocoa or Carbon classes in order to have a widget that allows me to do this?
In NSTextView you have the methods loosenKerning and tightenKerning for example, although this does not apply automatically in a table. (I’m not a Cocoa developer so I don’t know where to set this property on OS X either.)

Hopefully, someone knows what I’m talking about.

Any ideas how to implement this?
/rike

caduel
21st October 2009, 16:00
QFont has a kerning property. (see QFont::kerning(), also see QFont::setLetterSpacing())
So you could write code that upon a resize adjust the font('s kerning) property for that column.

Debilski
22nd October 2009, 19:11
Thanks. I hoped that someone had done this earlier and there is an implementation to it available.