×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Lock / Unlock device from Qt

    Hello everyone. I'm new to this forum and i need a little help from you.
    Using QSystemDeviceInfo is possible to detect is the symbian device is locked or unlocked.

    But IS there any solution to programaticaly Lock/Unlock the device screen ?

    I know there are some symbian API but i dont know how to use them in QT.

    Any help will be appreciated.

  2. #2
    Registered User
    Join Date
    Jun 2010
    Posts
    63

    Re: Lock / Unlock device from Qt

    #if defined(Q_OS_SYMBIAN)
    RAknKeyLock aKeyLock;
    aKeyLock.Connect(); //init

    TBool isLocked = aKeyLock.IsKeyLockEnabled(); //return TBool to check if enabled

    // aKeyLock.EnableKeyLock() or aKeyLock.EnableWithoutNote(); //enables keypad lock

    // aKeyLock.DisableKeyLock() or aKeyLock.DisableWithoutNote(); //disables keypad lock
    TBuf<10> buf;
    buf.Num(isLocked);
    QString qString((QChar*)buf.Ptr(),buf.Length());

    aKeyLock.Close();

    ui->textBrowser->setText(qString);
    #endif

    use these symbian code todo get the status
    更多信息,示例参考
    http://wiki.forum.nokia.com/index.php/Qt_开发

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    63

    Re: Lock / Unlock device from Qt

    add libs in pro file
    LIBS += -lavkon

    need head #include "aknkeylock.h"
    更多信息,示例参考
    http://wiki.forum.nokia.com/index.php/Qt_开发

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Lock / Unlock device from Qt

    Quote Originally Posted by JKoder View Post
    Hello everyone. I'm new to this forum and i need a little help from you.
    Using QSystemDeviceInfo is possible to detect is the symbian device is locked or unlocked.

    But IS there any solution to programaticaly Lock/Unlock the device screen ?

    I know there are some symbian API but i dont know how to use them in QT.

    Any help will be appreciated.
    Hi,

    Ya this Class holds the locking property of the device.

    http://doc.qt.nokia.com/qtmobility-1...eviceinfo.html

    Currently this locking property is in review in bug-report : http://bugreports.qt.nokia.com/brows...s:all-tabpanel

    Best regards,

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Re: Lock / Unlock device from Qt

    Thank you very much for your help !
    I really appreciate it !

  6. #6
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Re: Lock / Unlock device from Qt

    Quote Originally Posted by rahulvala View Post
    Hi,

    Ya this Class holds the locking property of the device.

    http://doc.qt.nokia.com/qtmobility-1...eviceinfo.html

    Currently this locking property is in review in bug-report : http://bugreports.qt.nokia.com/brows...s:all-tabpanel

    Best regards,
    I know this Class holds the loking property ( locked or not ) but it cannot actualy LOCK the device if needed.
    I have tryed the other example, but on build i get alot of error ( over 3000 ) and i a bit stuck.
    Any other help ?
    Thank you very much.

Similar Threads

  1. cant develop key lock/unlock
    By Meehdi in forum Symbian
    Replies: 1
    Last Post: 2010-08-19, 09:06
  2. Replies: 2
    Last Post: 2009-08-12, 07:45
  3. lock-unlock keypad
    By cool_eagle in forum Symbian
    Replies: 5
    Last Post: 2008-08-27, 08:11
  4. 6310i Lock and Unlock
    By lava10 in forum General Development Questions
    Replies: 0
    Last Post: 2004-01-28, 13:55
  5. programmatically lock/unlock keypad
    By asangamneheri in forum Symbian
    Replies: 8
    Last Post: 2003-11-06, 09:27

Posting Permissions

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