Results 1 to 2 of 2

Thread: string height

  1. #1
    Join Date
    Jan 2006
    Posts
    5
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default string height

    Is it possible to get the exact string height (pixels)?

    I mean something like QFontMetrics::height() or QFontMetrics::boundingRect() but both height() and boundingRect() give some abstract height related to the current font (not to the particular string)

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: string height

    I suppose that you can render your string to a pixmap and then look for the top and bottom pixels yourself. There is no Qt method for this.

Similar Threads

  1. Set height of QTableView to fit exact number of rows.
    By Ben.Hines in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2019, 01:49
  2. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40
  3. QTextEdit height using Qt3.3.5
    By vermarajeev in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2006, 08:43
  4. height()
    By mickey in forum Newbie
    Replies: 1
    Last Post: 22nd March 2006, 20:32
  5. [Qt4] Noob and custom Item Delegate
    By naresh in forum Newbie
    Replies: 36
    Last Post: 19th March 2006, 15:46

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.