Results 1 to 4 of 4

Thread: Font Size

  1. #1
    Join Date
    Jan 2008
    Posts
    72
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Thumbs up Font Size

    Hello everyone
    I have a little problem and I hope you will solve it......
    My problem is that I wana create a dynamic widget and set its geometry according to the QString Size i.e If I write a string "Hello " and the font size of this string is 32,then I wana set height and width of the widget according to this string size..........
    But I have no any idea how I do ??????

    Please help me......................
    Thanx

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Font Size

    QFontMetrics is what you need to use to find out the height and width of your string.

  3. #3
    Join Date
    Jan 2008
    Posts
    72
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Thumbs up Re: Font Size

    Thanx ................................

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Font Size

    Of course you are aware of the existance of QLabel, right?

Similar Threads

  1. Font size of a spinbox
    By SailinShoes in forum Qt Programming
    Replies: 6
    Last Post: 5th May 2008, 14:29
  2. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  3. Replies: 3
    Last Post: 30th January 2007, 07:35
  4. QTreeView font size not being set
    By forrestfsu in forum Qt Tools
    Replies: 2
    Last Post: 12th October 2006, 13:53
  5. change font size and button size of QMessageBox
    By nass in forum Qt Programming
    Replies: 6
    Last Post: 13th September 2006, 19:16

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.