Change font in Qt application

From Qt Wiki
Jump to navigation Jump to search

Template:Abstract

Template:ArticleMetaData

Headers required[edit | edit source]

  1. include <QFont>

Source[edit | edit source]

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

Postconditions[edit | edit source]

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

Further links[edit | edit source]

Code Example[edit | edit source]

  • 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.
pt:Archived:Como modificar a fonte de aplicações, em Qt