Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Light sensor start fail



  • I am using the light sensor(QLightSensor) to read the light data. It works well on the simulator.
    But failed on the real device(C7)

    I debug, and find out that the sensor.start() return false.

    why??



  • The code is rather simple:

    @
    QLightSensor* m_LightSensor;
    QLightReading* m_LuxReading;

    m_LightSensor = new QLightSensor(this);
    bool started = m_LightSensor->start();

    if(!started)
    {
    return;
    }
    m_LuxReading = m_LightSensor->reading();
    @
    then it always start fail.
    The capability is added, NetworkServices ReadDeviceData WriteDeviceData ReadUserData WriteUserData
    I have add the heap : TARGET.EPOCHEAPSIZE = 0x020000 0x1000000



  • I tested with QAmbientLightSensor, this works well. Then I change to QLightSensor, it failed. WHY??



  • I use QList<QByteArray> sensorArray = QSensor::sensorTypes();
    and it seems that the lightsensor is not included in the symbian system.


Log in to reply