Results 1 to 2 of 2

Thread: dynamically chaging font depending on resolution..

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default dynamically chaging font depending on resolution..

    Hi all,

    I wish to set the font of my application dynamically such that it works on the different machines which have different resolutions.
    In case I use the default font provided by the Qt then on the giant screen the dialogs and its corresponding text appears very small.
    And if I set this font to be big in the beginning then on the desktop machines my application will not scale properly.

    So is there any way to dynamically change the font depending upon the screen size nd resolution.

    Thanx in advance...

    Neeraj

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dynamically chaging font depending on resolution..

    You can change size of font,,, and u can determine screen resolution.
    Then why cant u combine both ??
    Well, get the resolution of the screen. Say size 12 works upto 800x600 resoltuon, 14 for 1024x768, and so on,,,, u can decide what font size suits a particular resolution.

    Then you can use QApplication::setFont to change the font of the application.

    Hope this helps

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.