PDA

View Full Version : dynamically chaging font depending on resolution..



Neeraj19
30th September 2008, 06:40
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

aamer4yu
1st October 2008, 11:09
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 :)