×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    94

    Disable screensaver and backlight

    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,

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Disable screensaver and backlight

    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

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    94

    Re: Disable screensaver and backlight

    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..

  4. #4
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Disable screensaver and backlight

    I want the screen to ba active as long as the app is running
    Qt Mobility 1.0 supports that ....
    QSystemScreenSaver *sss=new QSystemScreenSaver ( this );
    sss->setScreenSaverInhibit();

Similar Threads

  1. Disable screensaver and backlight
    By Maysoon88 in forum Qt
    Replies: 1
    Last Post: 2010-11-29, 15:16
  2. Screensaver / Autolock and Backlight problem
    By kbateman in forum Symbian User Interface
    Replies: 7
    Last Post: 2010-08-17, 16:05
  3. Cannot turn backlight ON in my screensaver
    By sumanta_datta in forum Streaming and Video
    Replies: 1
    Last Post: 2007-04-27, 11:03
  4. backlight off but not activate screensaver
    By yyyly in forum Symbian
    Replies: 0
    Last Post: 2006-10-20, 06:57
  5. N7650 / C++ / Disable ScreenSaver? Keep backlight on?
    By The.French.DJ in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-05-05, 12:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×