Discussion Board

Results 1 to 4 of 4

Thread: QML LightSensor

  1. #1
    Registered User AKLong's Avatar
    Join Date
    Jun 2009
    Posts
    7
    Hi,

    Has anybody managed to get the QML LightSensor working?

    I have the following code:-

    Code:
       LightSensor{
            id: ls
            dataRate: 1000
            onReadingChanged: {
                lsText.text=reading.lux
            }
        }
    This works fine on the simulator and the text box gets updated correctly. But on my Nokia C7 (running Belle) the text box does not update - the application does not show any errors either.

    Anybody got any ideas?

    Thanks

    Andy

  2. #2
    Registered User kusumk's Avatar
    Join Date
    Sep 2011
    Posts
    449
    Hi,

    I tried the same on N9, same for me, it didnt work,

    Seems onReadingChanged function itself is not being called.

    Andy, How did you test it on simulator, as i couldnt get it running on simulator either.

  3. #3
    Registered User AKLong's Avatar
    Join Date
    Jun 2009
    Posts
    7
    I didn't do anything 'special' to get it working on the simulator. I was using the new simulator in the 1.2 SDK.

  4. #4
    Nokia Developer Expert Devnull's Avatar
    Join Date
    Sep 2011
    Posts
    381
    According to device specification, the device has ambient light sensor, did you try using the QML AmbientLightSensor Element instead of the LightSensor?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved