Solved Reading AmbientLight from android: Fatal signal 11 (SIGSEGV), code 1,
-
Hello, am trying to read the ambientlight from my android and the error: Fatal signal 11 (SIGSEGV), code 1, occurs anytime i push the button to receive the values. Here is my code```
void MainWindow::read()
{ qDebug()<<"here....";
QAmbientLightSensor sensor;
QAmbientLightReading *value = sensor.reading();
qDebug()<<value->lightLevel();
qDebug()<<text;
ui->display->setText(text);
} -
Hi,
Just a wild guess but you should check that "value" Is not a null pointer.
-
@SGaist yes I checked it's a null pointer. Please how do I resolve the problem?
-
@SGaist I have resolved the problem by: following the guide stated in the start slot of QSensor documentation