×

Discussion Board

Results 1 to 4 of 4

Thread: QML LightSensor

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    7

    QML LightSensor

    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
    Join Date
    Sep 2011
    Posts
    449

    Re: QML LightSensor

    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
    Join Date
    Jun 2009
    Posts
    7

    Re: QML LightSensor

    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
    Join Date
    Sep 2011
    Posts
    382

    Re: QML LightSensor

    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
  •  
×