Results 1 to 3 of 3

Thread: Column width sensitive kerning in QTableView

  1. #1
    Join Date
    Jul 2008
    Posts
    16
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Column width sensitive kerning in QTableView

    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
    Last edited by Debilski; 21st October 2009 at 16:04. Reason: Given a more speaking title

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Column width sensitive kerning in QTableView

    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.

  3. The following user says thank you to caduel for this useful post:

    Debilski (22nd October 2009)

  4. #3
    Join Date
    Jul 2008
    Posts
    16
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Column width sensitive kerning in QTableView

    Thanks. I hoped that someone had done this earlier and there is an implementation to it available.

Similar Threads

  1. One Model, Two Views (QTreeView and QTableView)
    By dgarrett97 in forum Newbie
    Replies: 2
    Last Post: 14th September 2009, 19:10
  2. Replies: 2
    Last Post: 7th June 2009, 11:47
  3. QTableView
    By dragon in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2008, 17:53
  4. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 15:43
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 14:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.