Hi All,
please can anyone tell me how to use User::ResetInactivityTime() to disable screensaver and backlight in application I want the screen to ba active as long as the app is running HELP!
Thanks,
Printable View
Hi All,
please can anyone tell me how to use User::ResetInactivityTime() to disable screensaver and backlight in application I want the screen to ba active as long as the app is running HELP!
Thanks,
Hi Maysoon88,
It is simple if you are aware of using Qt and Symbian C++ together. What you have to do is to use the QTimer class and create a slot which will get called at regular instants to reset the inactivity.To help you further, let me make it more clear by writing the whole procedure :
1- Include the required headers
[CODE]#include <eikenv.h> //its a Symbian C++ header that includes the User class
#include <QTimer> [/CODE]
2- Declare a slot in the .h file :
[CODE]
private slots:
void reset_timer();[/CODE]
3- Define this slot in respective .cpp file :
[CODE]
void MainWindow::reset_timer()
{
#if defined(Q_WS_S60)
User::ResetInactivityTime();
#endif
}[/CODE]
4- Thats it. Now, call this slot at regular instants by using QTimer Class :
[CODE]
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(reset_timer()));
timer->start(5000); //keep calling the SLOT after 5000 ms[/CODE]
Thats it. Hope it helps ;)
Best Regards,
SajiSoft
Thank u sajisoft :)
Actually I already have a repetitive function I call every second I called User::ResetInactivityTime() in it and it works well now thank u its my mistake I had to confirm that I solved that issue...thank you again..:D
[QUOTE]I want the screen to ba active as long as the app is running [/QUOTE]
Qt Mobility 1.0 supports that ....
QSystemScreenSaver *sss=new QSystemScreenSaver ( this );
sss->setScreenSaverInhibit();