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>
2- Declare a slot in the .h file :
Code:
private slots:
void reset_timer();
3- Define this slot in respective .cpp file :
Code:
void MainWindow::reset_timer()
{
#if defined(Q_WS_S60)
User::ResetInactivityTime();
#endif
}
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
Thats it. Hope it helps 
Best Regards,
SajiSoft