Change font in Qt application
hamishwillee
(Talk | contribs) m (Text replace - "Category:MeeGo" to "Category:MeeGo Harmattan") |
hamishwillee
(Talk | contribs) m (Hamishwillee - Add Qt C++ UI category) |
||
| Line 1: | Line 1: | ||
| − | [[Category:Qt]][[Category:UI]][[Category:Code Examples]][[Category:MeeGo Harmattan]][[Category:Symbian]] | + | [[Category:Qt]][[Category:UI]][[Category:Code Examples]][[Category:MeeGo Harmattan]][[Category:Symbian]][[Category:Qt C++ UI]] |
{{Abstract|This code example shows how to change font of a Qt (C++) application. This is done by setting the desired font {{Qapiname|QFont}} using {{Qapiname|QApplication::setFont()}}.}} | {{Abstract|This code example shows how to change font of a Qt (C++) application. This is done by setting the desired font {{Qapiname|QFont}} using {{Qapiname|QApplication::setFont()}}.}} | ||
| Line 49: | Line 49: | ||
==Further links== | ==Further links== | ||
| − | * | + | * {{Qapiname|QFont}} |
* [[How to use QFontComboBox]] | * [[How to use QFontComboBox]] | ||
Revision as of 08:49, 17 September 2012
This code example shows how to change font of a Qt (C++) application. This is done by setting the desired font QFont using QApplication::setFont().
Article Metadata
Code Example
Source file: Media:QtChangeFont.zip
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): Symbian^1,Symbian^3, Meamo, MeeGo
Platform Security
Signing Required: Self-Signed
Article
Keywords: Font
Created: savaj
(12 Jun 2009)
Last edited: hamishwillee
(17 Sep 2012)
Contents |
Headers required
#include <QFont>Source
//specify a new font.
QFont newFont("Courier", 8, QFont::Bold, true);
//set font of application
QApplication::setFont(newFont);
Postconditions
The code snippet is expected to show font "Courier" on application.
Further links
Code Example
- File:QtChangeFont.zip shows how you can change text from font Courier to font Times from the menu. The example is tested on Nokia 5800 XpressMusic.

