×
Namespaces

Variants
Actions
(Difference between revisions)

Change font in Qt application

From Nokia Developer Wiki
Jump to: navigation, search
savaj (Talk | contribs)
(Savaj - - rename from Nokia Qt SDK to Qt SDK)
savaj (Talk | contribs)
(Savaj - Edited compatible platform)
Line 1: Line 1:
[[Category:Qt]][[Category:UI]]
+
[[Category:Qt]][[Category:UI]][[Category:Code Examples]]
 
{{ReviewerApproved|timestamp=20090921}}
 
{{ReviewerApproved|timestamp=20090921}}
  
 
{{ArticleMetaData
 
{{ArticleMetaData
 
|id=...
 
|id=...
|platform=S60 3rd Edition, FP1, FP2<br>S60 5th Edition
+
|platform=Symbian^1,Symbian^3
 
|devices=Nokia 5800 XpressMusic
 
|devices=Nokia 5800 XpressMusic
 
|category=Qt
 
|category=Qt
Line 66: Line 66:
  
 
* [[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.
 
* [[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.
 
 
 
[[Category:Code Examples]]
 

Revision as of 19:09, 22 October 2011

{{{width}}}
21 Sep
2009
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): Symbian^1,Symbian^3
Symbian
Article
Keywords: Font
Created: savaj (12 Jun 2009)
Last edited: savaj (22 Oct 2011)

Contents

Overview

This code example shows how to change font of application an in Qt. This is done by setting the desired font QFont using QApplication::setFont().

This snippet can be self-signed.

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

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

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×