Changing profile programmatically in Qt
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
Tested with
Compatibility
S60 5th Edition
Article
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


21 Sep
2009
This article shows how you can change profile using widget.Here XQProfile class is used and a method setActiveProfile() is used.The source code addresses two types for setting profile. one is generel and the other is silent. As mentioned in this article that to run the application , a developer certificate is needed and this application required WriteUserData capability.So that is good thing to mention it.