Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Reading AmbientLight from android: Fatal signal 11 (SIGSEGV), code 1,

Reading AmbientLight from android: Fatal signal 11 (SIGSEGV), code 1,

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 646 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gblessed
    wrote on last edited by
    #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);
    }

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Just a wild guess but you should check that "value" Is not a null pointer.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Just a wild guess but you should check that "value" Is not a null pointer.

        G Offline
        G Offline
        gblessed
        wrote on last edited by
        #3

        @SGaist yes I checked it's a null pointer. Please how do I resolve the problem?

        G 1 Reply Last reply
        0
        • G gblessed

          @SGaist yes I checked it's a null pointer. Please how do I resolve the problem?

          G Offline
          G Offline
          gblessed
          wrote on last edited by
          #4

          @SGaist I have resolved the problem by: following the guide stated in the start slot of QSensor documentation

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved