×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Qt Mobility and lock status problem

    I'm trying to catch device lock (screen lock & PIN lock) status changes in my QML application. DeviceInfo element of Qt Mobility 1.2 API provides an easy way to monitor lock status changes, but for some reason I just can't get it working on Symbian, even though the same code works well on Harmattan!

    Here is a simplified example code:

    Code:
    Page {
        ...
        DeviceInfo {
            monitorLockStatusChanges: true
    
            onLockStatusChanged: {
                console.log("Lock status changed!");
            }
        }
    }
    Imports and so on should be correct and I have also tried to add all the capabilities that the developer certificate allows for the application, if and when some of those are needed.

    Has anyone else tried to use this API? Maybe this is a real bug in Qt Mobility on Symbian side?

    Searching the problem hasn't produced any relevant results. I know that there is some Symbian C++ API that could be used if nothing else works, but I would rather use QML/Qt APIs.

    For the record, my Symbian development device is Nokia C7 with Symbian Belle installed (i.e. Qt 4.7.4 & Qt Mobility 1.2).

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Qt Mobility and lock status problem

    Hi,

    Does it report as element not found by any chance, the reason i asked this is because there was this thread where NetworkInfo did not work just due to the order in which imports were written -

    import QtQuick 1.1
    import com.nokia.symbian 1.1
    import QtMobility.systeminfo 1.1
    Last edited by kusumk; 2012-04-25 at 09:26.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Re: Qt Mobility and lock status problem

    Quote Originally Posted by kusumk View Post
    Hi,

    Does it report as element not found by any chance, the reason i asked this is because there was this thread where NetworkInfo did not work just due to the order in which imports were written -

    import QtQuick 1.1
    import com.nokia.symbian 1.1
    import QtMobility.systeminfo 1.1
    Oh, that is some really strange but interesting piece of information! I think I haven't got any errors on console, though. But as a matter of fact, I do have those imports in different order:

    import QtQuick 1.1
    import QtMobility.systeminfo 1.2
    import com.nokia.symbian 1.1

    I have to switch the order and try it later today. Let's see if the problem really could be because this. I'll let you know the results. Then again, identical code to follow Bluetooth state worked well, when I tried that while debugging the problem:

    Code:
    Page {
        ...
        DeviceInfo {
            monitorBluetoothStateChanges: true
    
            onBluetoothStateChanged: {
                console.log("Bluetooth status changed!");
            }
        }
    }

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Qt Mobility and lock status problem

    OK May be you can try it once.
    I tried meanwhile with monitorLockStatusChanges, and it didnot work for me too. Need to check if it is actually implemented.

    Also just to mention caps -

    symbian:TARGET.CAPABILITY += NetworkServices \
    LocalServices \
    ReadUserData \
    WriteUserData \
    UserEnvironment \
    ReadDeviceData \
    WriteDeviceData
    Last edited by kusumk; 2012-04-25 at 10:48.

  5. #5
    Registered User
    Join Date
    Jan 2012
    Posts
    33

    Re: Qt Mobility and lock status problem

    Code:
    import QtMobility.systeminfo 1.2
    
    DeviceInfo{
            id:deviceInfo
            monitorDeviceLocks: true
            onDeviceLocked: {
                if(isDeviceLocked){
                    print("locked");
                }
             }
    }
    while in pro try to add this if you didn't previously:
    Code:
    MOBILITY += location systeminfo
    thanks to this i can monitor the device lock... it's working pretty good on simulator and on device Anna / Belle

  6. #6
    Registered User
    Join Date
    Nov 2011
    Posts
    5

    Re: Qt Mobility and lock status problem

    Quote Originally Posted by kallela View Post
    I have to switch the order and try it later today. Let's see if the problem really could be because this. I'll let you know the results.
    No, it was not about the order of the imports.

    Quote Originally Posted by francesco_it View Post
    Code:
    import QtMobility.systeminfo 1.2
    
    DeviceInfo{
            id:deviceInfo
            monitorDeviceLocks: true
            onDeviceLocked: {
                if(isDeviceLocked){
                    print("locked");
                }
             }
    }
    while in pro try to add this if you didn't previously:
    Code:
    MOBILITY += location systeminfo
    thanks to this i can monitor the device lock... it's working pretty good on simulator and on device Anna / Belle
    I can't get that code working either. Is that location module really needed or do you just happen to have it there? How about the capabilities? Which ones you have added and do you know which ones are actually needed? I tried to add all the capabilities the developer certificate allows, but still no luck.

Similar Threads

  1. Nokia Qt SDK 1.0.2 and Mobility Location - can't get GPS lock
    By igor.sos in forum [Archived] Qt Mobility Project
    Replies: 2
    Last Post: 2010-12-27, 04:57
  2. Controlling Num Lock and Caps Lock Icon Display
    By pgarofalo in forum Symbian
    Replies: 1
    Last Post: 2010-04-21, 00:23
  3. Problem with Qt Mobility
    By picachu.nioto in forum [Archived] Qt Mobility Project
    Replies: 7
    Last Post: 2010-04-06, 05:28
  4. Device lock status
    By itsme in forum Symbian
    Replies: 7
    Last Post: 2009-10-22, 04:49
  5. Replies: 8
    Last Post: 2008-09-01, 02:40

Posting Permissions

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