• May 02, 2024, 02:11:04 am

Author Topic: how to lock/unlock the device from Qt/QtQuick via native C++  (Read 3996 times)

0 Members and 1 Guest are viewing this topic.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
how to lock/unlock the device from Qt/QtQuick via native C++
« on: August 21, 2013, 12:52:34 am »
1. add
Code: [Select]
LIBS += -lavkon
to your .pro file in Symbian {}

2. include
Code: [Select]
#include "aknkeylock.h"
to your class/header/main.cpp

3. Now put this code into your function:
Code: [Select]
RAknKeyLock aKeyLock;   
CleanupClosePushL(aKeyLock);
User::LeaveIfError(aKeyLock.Connect());
aKeyLock.EnableWithoutNote();
//aKeyLock.DisableWithoutNote();
CleanupStack::PopAndDestroy(&aKeyLock);

really easy ;)
« Last Edit: November 02, 2013, 09:07:09 pm by huellif »

Offline mahindar

  • Developer
  • New Member
  • ****
  • Posts: 25
  • Reputation: 11
  • Symbian Power User
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #1 on: August 21, 2013, 12:33:44 pm »
once again a cool tutorial from you :)
Expecting some more tips ;)

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #2 on: August 21, 2013, 01:46:27 pm »
once again a cool tutorial from you :)
thanks my friend ;)

Quote
Expecting some more tips ;)
later I will create a simple multilanguage tutorial for a QtQuick UI.

Offline pisarz1958

  • Developer
  • New Member
  • ****
  • Posts: 26
  • Reputation: 27
  • Oh, I have this little field in my profile!
  • Current Phone: : Nokia 500
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #3 on: August 23, 2013, 05:03:38 am »
Can I lock the screen but leave it on just like SMS message does?

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #4 on: August 23, 2013, 05:42:50 am »
sorry I don't get you?

Offline pisarz1958

  • Developer
  • New Member
  • ****
  • Posts: 26
  • Reputation: 27
  • Oh, I have this little field in my profile!
  • Current Phone: : Nokia 500
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #5 on: August 23, 2013, 05:53:09 am »
Ok. When you get a SMS message with phone locked, screen is turned on for a while and showing lockscreen with notification (at least on Belle Refresh). I'd like to replicate such behavior.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #6 on: August 23, 2013, 12:10:57 pm »
first of all it's not possible to add a notification to lockscreen :(
and I don't know how to stop screensaver and show lockscreen

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #7 on: August 23, 2013, 08:54:05 pm »
Did you have any luck with looking in the old Symbian sources huellif?

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #8 on: August 24, 2013, 01:53:33 am »
sorry, still had no time to search it.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: how to lock/unlock the device from Qt/QtQuick via native C++
« Reply #9 on: November 02, 2013, 09:07:24 pm »
*fixed exception handling