×
Namespaces

Variants
Actions
(Difference between revisions)

Change font in Qt application

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Added category Category:Symbian. (Preparing for ontology change))
hamishwillee (Talk | contribs)
m (Remove platform specifier categories (only need specifier for Qt if there is some platform specific behaviour))
Line 1: Line 1:
 +
[[Category:Qt]][[Category:Symbian]][[Category:UI]]
 
{{ReviewerApproved}}
 
{{ReviewerApproved}}
  
Line 19: Line 20:
 
==Preconditions==
 
==Preconditions==
  
* Download and Install latest version [[Qt for Symbian - Installation packages]] which has links on how to install the latest version
+
* Install [[Nokia Qt SDK]]
  
 
==Headers required==
 
==Headers required==
Line 56: Line 57:
 
==Code Example==
 
==Code Example==
  
* The [[Media: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.
+
* 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.
  
  
  
[[Category:Qt]][[Category:Qt for Symbian]][[Category:Code Examples]][[Category:UI]] [[Category:Symbian]]
+
[[Category:Code Examples]]

Revision as of 07:33, 4 April 2011

{{{width}}}
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
Symbian
Article
Keywords: QApplication::setFont(), QApplication::font()
Created: (12 Jun 2009)
Last edited: hamishwillee (04 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

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)

Font1.JPG

After changing font to Times
Font2.JPG


External links

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.
516 page views in the last 30 days.
×