3

I have created simple Qt Quick 2 project. I want to access gyroscope.

import QtQuick 2.1
import QtSensors 5.0

Rectangle {
    id: root
    color: "black"

    GyroscopeReading {
        onXChanged: {

        }
        onYChanged: {

        }
        onZChanged: {

        }
    }
}

In .pro file I added 'QT += sensors'.

My application doesn't work. I see white screen. In the application output I see 'module "QtSensors" plugin "declarative_sensors" not found'

What am I doing wrong?

Thanks!

dasg
  • 321
  • 9
  • 18

1 Answers1

0

fixed it by making these changes in the QML file:

import QtSensors 5.0 as Sensors
...
Sensors.Accelerometer {
....
}

from here: http://qt-project.org/forums/viewthread/37033/

lennon310
  • 12,503
  • 11
  • 43
  • 61