Change font in Qt application
hamishwillee
(Talk | contribs) m (Remove platform specifier categories (only need specifier for Qt if there is some platform specific behaviour)) |
somnathbanik
(Talk | contribs) |
||
| Line 7: | Line 7: | ||
|devices=Nokia 5800 XpressMusic | |devices=Nokia 5800 XpressMusic | ||
|category=Qt for Symbian | |category=Qt for Symbian | ||
| − | |subcategory= | + | |subcategory= QFont |
|creationdate=June 12, 2009 | |creationdate=June 12, 2009 | ||
|keywords=QApplication::setFont(), QApplication::font() | |keywords=QApplication::setFont(), QApplication::font() | ||
| Line 14: | Line 14: | ||
==Overview== | ==Overview== | ||
| − | This code snippets shows how to change font of application in Qt. API | + | {{Abstract|This code snippets shows how to change font of application in Qt. API {{Icode|QApplication::setFont()}} will set the font of application, and it take {{Icode|QFont}} as parameter. so normally we need to specify font using {{Icode|QFont API}}.}} |
| − | This snippet can be self-signed. As it does not use any API which require developer/certified signing. | + | This snippet can be '''self-signed'''. As it does not use any API which require developer/certified signing. |
==Preconditions== | ==Preconditions== | ||
Revision as of 16:54, 29 April 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: QApplication::setFont(), QApplication::font()
Created: (12 Jun 2009)
Last edited: somnathbanik
(29 Apr 2011)
Contents |
Overview
This code snippets shows how to change font of application in Qt. API QApplication::setFont() will set the font of application, and it take QFont as parameter. so normally we need to specify font using QFont API.
This snippet can be self-signed. As it does not use any API which require developer/certified signing.
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
- QFont: QFont reference
Internal Links
Code Example
- The [File:QtChangeFont.zip|Code Example]] will show font Courier and you can change it to Times from menu. The example is tested on Nokia 5800 XpressMusic.

