Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.1.1
-
None
-
Linux sensor plugin
-
e3e80980ca6a4628bf7a0dae61d9ab140913518c
Description
According to the documentation from https://qt-project.org/doc/qt-5.1/qtsensors/qml-qtsensors5-sensorglobal.html
The following code should output a list of available sensors in a console
import QtQuick 2.0 import QtSensors 5.1 import QtSensors 5.1 as Sensors Rectangle { width: 360 height: 360 Text { id: outTxt text: qsTr("Hello World") anchors.centerIn: parent } MouseArea { anchors.fill: parent onClicked: { Qt.quit(); } } Accelerometer { active: true onReadingChanged: { outTxt.text = "x: " + reading.x + "\ny: " + reading.y + "\nz: " + reading.z } } Component.onCompleted: { var types = Sensors.sensorTypes(); console.log(types.join(", ")); } }
But instead I get a TypeError:
TypeError: Object [object Object] has no method 'sensorTypes'
Attachments
Issue Links
- is required for
-
QTBUG-33559 Reimplement Sensor Explorer example entirely in qml
- Closed