[英]Qt/QML on Android - onReadingChanged
我一步一步地按照非常好的Digia示例在Android上运行Qt / QML 。
当我从IDE-Qt单击[build]时,输出看起来不错:
Running steps for project bubble...
Configuration unchanged, skipping qmake step.
Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
The process "/usr/bin/make" exited normally.
Elapsed time: 00:00.
[运行QMake]
Running steps for project bubble...
Starting: "/.../qt5/creator/Qt5.1.1/5.1.1/gcc_64/bin/qmake" /~/Desktop/bubble/bubble.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
The process "/.../qt5/creator/Qt5.1.1/5.1.1/gcc_64/bin/qmake" exited normally.
[跑]
QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component
qrc:///bubble.qml:38 Cannot assign to non-existent property "onReadingChanged"
我还读到qtviewer在Qt5上没有更多使用: 没有安装qmlviewer 。
安装了Android SDK NDK,并且设备已启用且处于开发人员模式,并且因为错误消息只是抱怨QML,我想这不应该是应用程序无法运行的原因。
欢迎所有建议。
您的传感器未正确设置/激活。 尝试这个:
OrientationSensor {
id: orientation
active: true
onReadingChanged: {
if (reading.orientation == OrientationReading.FaceUp)
content.state = "FaceUp";
// ... more tests for different orientations ...
}
}
有关详细信息,请查看QtMobility 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.