Results 1 to 3 of 3

Thread: QFont and DPI

  1. #1
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default QFont and DPI

    Hello.

    I have some custom widgets with text. The space for the text is static; therefore, the size of the font should also remain static. The problem is that on a system with different DPI the text gets resized. This either causes the text to be too small, or it causes the text to be too large and not fit in the widget.

    How do I make sure size of text remains the same regardless of DPI?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QFont and DPI

    Use pixel size:QFont::setPixelSize().

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

    ArlexBee-871RBO (9th March 2010)

  4. #3
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Re: QFont and DPI

    Great. Just what I needed.

    Thanks

Similar Threads

  1. QFont, inclination
    By Piskvorkar in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2009, 09:36
  2. QFont problem.
    By anafor2004 in forum Newbie
    Replies: 2
    Last Post: 18th June 2008, 17:25
  3. charset in QFont?
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 1st October 2007, 11:40
  4. QFont
    By ghorwin in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2007, 21:44
  5. Default value for QFont
    By Kapil in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2006, 06:40

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.