Changing profile programmatically in Qt
Overview[edit | edit source]
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 76ytuiytuityutyutututyutyutyu. 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 76ytuiytuityutyutututyutyutyu of class 76ytuiytuityutyutututyutyutyu will change profile to given parameter. This snippet requires 76ytuiytuityutyutututyutyutyu capability. Self-signing is not possible because a Developer certificate is needed.
Headers required[edit | edit source]
#include "XQProfile.h"
.pro file[edit | edit source]
Add following lines to your .pro file.
symbian:LIBS += -lprofileengine \
-letel3rdparty \
-lfeatdiscovery
symbian:TARGET.CAPABILITY += WriteDeviceData
Source code[edit | edit source]
/* 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[edit | edit source]
This application has been tested on Nokia 5800 XpressMusic.
Download Code Example[edit | edit source]
- Original source code can be downloaded from here : QtProfile.Zip