×
Namespaces

Variants
Actions

Changing profile programmatically in Qt

From Nokia Developer Wiki
Jump to: navigation, search

This article provides an API which you can use to read and set the standard Symbian device profiles from your Qt application.

Article Metadata
Code Example
Source file: Media:QtProfile.zip
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
Symbian
Article
Keywords: profile
Created: savaj (30 Jun 2009)
Last edited: hamishwillee (11 Oct 2012)

Contents

Overview

The Profile API can be used for changing between different profiles and also for fetching the current active profile. The main class of the API is XQProfile. The API only works for the predefined profiles so custom profiles are not supported. The API does not provide methods for creating new profiles or modifying profiles that are not predefined. This code snippets/example shows how to change profile programmatically using a convenience API that calls functions in Symbian C++. Note that if you just want to read the profile you should use the Qt Mobility API QSystemDeviceInfo

The method setActiveProfile() of class XQProfile will change profile to given parameter. This snippet requires WriteUserData capability. Self-signing is not possible because a Developer certificate is needed.

Headers required

 #include "XQProfile.h"

.pro file

Add following lines to your .pro file.

symbian:LIBS += -lprofileengine \
-letel3rdparty \
-lfeatdiscovery
 
symbian:TARGET.CAPABILITY += WriteDeviceData

Source code

/* initialize XQProfile */
XQProfile* profile = new XQProfile(this);
/* to set the profile to General */
bool result = profile->setActiveProfile(XQProfile::ProfileGeneral);
 
/* to set the profile to Silent */
bool result = profile->setActiveProfile(XQProfile::ProfileSilent);

Tested on device

This application has been tested on Nokia 5800 XpressMusic.

Download Code Example

  • Original source code can be downloaded from here : QtProfile.Zip


This page was last modified on 11 October 2012, at 04:16.
70 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.

×