Change font in Qt application
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.
- Download Qt for S60 Garden release from here: Qt for S60 "Garden" pre-release
- Install Qt for S60:Installing Qt on S60
- Check this link for installation guide: How to install the package.
- Go through this article: Getting started with Qt for S60
//specify a new font.
QFont newFont("Courier", 8, QFont::Bold, true);
//set font of application
- QFont: QFont reference
- The Code Example will show font Courier and you can change it to Times from menu. The example is tested on Nokia 5800 XpressMusic.