Change font in Qt application
girishpadia
(Talk | contribs) |
hamishwillee
(Talk | contribs) m (Tidy up Abstract) |
||
| Line 1: | Line 1: | ||
| − | [[Category:Qt | + | [[Category:Qt]][[Category:UI]] |
| − | {{ReviewerApproved}} | + | {{ReviewerApproved|timestamp=20090921}} |
{{CodeSnippet | {{CodeSnippet | ||
| Line 6: | Line 6: | ||
|platform=S60 3rd Edition, FP1, FP2<br>S60 5th Edition | |platform=S60 3rd Edition, FP1, FP2<br>S60 5th Edition | ||
|devices=Nokia 5800 XpressMusic | |devices=Nokia 5800 XpressMusic | ||
| − | |category=Qt | + | |category=Qt |
| − | |subcategory= | + | |subcategory= UI |
|creationdate=June 12, 2009 | |creationdate=June 12, 2009 | ||
| − | |keywords= | + | |keywords=Font |
}} | }} | ||
==Overview== | ==Overview== | ||
| − | {{Abstract|This code | + | {{Abstract|This code example shows how to change font of application an in Qt. This is done by setting the desired font {{Qapiname|QFont}} using {{Qapiname|QApplication::setFont()}}.}} |
| − | This snippet can be '''self-signed''' | + | This snippet can be '''self-signed'''. |
==Preconditions== | ==Preconditions== | ||
| Line 50: | Line 50: | ||
==External links== | ==External links== | ||
| − | * | + | * [http://doc.qt.nokia.com/stable/qfont.html QFont] |
==Internal Links== | ==Internal Links== | ||
| Line 57: | Line 57: | ||
==Code Example== | ==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. |
[[Category:Code Examples]] | [[Category:Code Examples]] | ||
Revision as of 02:15, 2 May 2011
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
S60 5th Edition
Article
Keywords: Font
Created: (12 Jun 2009)
Last edited: hamishwillee
(02 May 2011)
Contents |
Overview
This code example shows how to change font of application an in Qt. This is done by setting the desired font QFont using QApplication::setFont().
This snippet can be self-signed.
Preconditions
- Install Nokia Qt SDK
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.
Font Courier (Bold and Italic)
After changing font to Times
External links
Internal 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.

