Change font in Qt application
hamishwillee
(Talk | contribs) m (Tidy up Abstract) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData) |
||
| Line 2: | Line 2: | ||
{{ReviewerApproved|timestamp=20090921}} | {{ReviewerApproved|timestamp=20090921}} | ||
| − | {{ | + | {{ArticleMetaData |
|id=... | |id=... | ||
|platform=S60 3rd Edition, FP1, FP2<br>S60 5th Edition | |platform=S60 3rd Edition, FP1, FP2<br>S60 5th Edition | ||
| Line 10: | Line 10: | ||
|creationdate=June 12, 2009 | |creationdate=June 12, 2009 | ||
|keywords=Font | |keywords=Font | ||
| + | |||
| + | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| + | |installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) --> | ||
| + | |sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> | ||
| + | |devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) --> | ||
| + | |signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer --> | ||
| + | |capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) --> | ||
| + | |author=[[User:Savaj]] | ||
}} | }} | ||
Revision as of 12:06, 24 June 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: savaj
(12 Jun 2009)
Last edited: hamishwillee
(24 Jun 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.

