Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 01:13, 11 October 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Change font in Qt application

From Wiki
Jump to: navigation, search

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 ExampleTested with
Devices(s): Nokia 5800 XpressMusic
Platform(s): Symbian^1,Symbian^3, Meamo, MeeGo
Platform Security
Signing Required: Self-Signed
Keywords: Font
Created: savaj (12 Jun 2009)
Last edited: hamishwillee (11 Oct 2012)


Headers required

#include <QFont>


//specify a new font.
QFont newFont("Courier", 8, QFont::Bold, true);
//set font of application


The code snippet is expected to show font "Courier" on application.

Further links

Code Example

  • shows how you can change text from font Courier to font Times from the menu. The example is tested on Nokia 5800 XpressMusic.
This page was last modified on 11 October 2012, at 01:13.
450 page views in the last 30 days.