What causes a QSensor to be unable to connect to a sensor backend?



  • I'm developing a C++ program to output accelerometer values to terminal on the Nexus 4 running Ubuntu Touch. However, when I run it on device, it gives me dummy values (x = 0, y = 9.8, z = 0).

    sensorsForType(QAccelerometer) gives me:
    core.accelerometer
    dummy.accelerometer

    defaultSensorForType is:
    core.accelerometer

    When I create an Accelerometer and check its identifier, it is dummy.accelerometer and I get the dummy values. If I set the identifier to core.accelerometer, the start() function returns 0 and as a result, isConnectedToBackend() is false.

    I suspect the backend couldn't be created and returned 0 but I'm not sure. isBackendRegistered() shows that core.accelerometer is registered. I couldn't seem to find any other debugging functions and I'm stumped at how to proceed, can someone advise on what to do next?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can use QT_DEBUG_PLUGINS=1 to see what happens with the plugins.

    However my first guess would be that ubuntu touch doesn't have a backend yet for Qt.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.