Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: huellif on August 21, 2013, 12:52:34 am

Title: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif 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 ;)
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: mahindar on August 21, 2013, 12:33:44 pm
once again a cool tutorial from you :)
Expecting some more tips ;)
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif 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.
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: pisarz1958 on August 23, 2013, 05:03:38 am
Can I lock the screen but leave it on just like SMS message does?
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif on August 23, 2013, 05:42:50 am
sorry I don't get you?
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: pisarz1958 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.
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif 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
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: Allstar12345 on August 23, 2013, 08:54:05 pm
Did you have any luck with looking in the old Symbian sources huellif?
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif on August 24, 2013, 01:53:33 am
sorry, still had no time to search it.
Title: Re: how to lock/unlock the device from Qt/QtQuick via native C++
Post by: huellif on November 02, 2013, 09:07:24 pm
*fixed exception handling