2013-12-17 23 views
1

我按照步骤一步步运行了非常漂亮的Digia示例,以运行Qt/QML on AndroidAndroid上的Qt/QML - onReadingChanged

当我点击[建设]从IDE-QT,输出看起来不错:

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" 

我也阅读qmlviewer在Qt5上没有更多使用: No qmlviewer installed

安装了Android SDK NDK,并且该设备已启用并处于开发人员模式,并且由于错误消息仅对QML抱怨,我猜这不应该是应用程序未运行的原因。

欢迎您提出任何建议。

回答

3

您的传感器没有正确设置/激活。试试这个:

OrientationSensor { 
id: orientation 
active: true 

onReadingChanged: { 

    if (reading.orientation == OrientationReading.FaceUp) 
     content.state = "FaceUp"; 

    // ... more tests for different orientations ... 
} 
} 

欲了解更多信息,请看QtMobility