gpt4 book ai didi

android - Android 上的 Qt/QML - onReadingChanged

转载 作者:行者123 更新时间:2023-11-30 02:50:11 25 4
gpt4 key购买 nike

我按照非常好的 Digia 示例一步一步地运行 Qt/QML on Android .

当我从 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"

我还读到 qmlviewer 在 Qt5 上的使用并不多: No qmlviewer installed .

Android SDK NDK已安装,设备已启用并处于开发者模式,由于错误消息仅提示QML,我想这应该不是应用程序未运行的原因。

欢迎所有建议。

最佳答案

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

OrientationSensor {
id: orientation
active: true

onReadingChanged: {

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

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

有关更多信息,请查看 QtMobility .

关于android - Android 上的 Qt/QML - onReadingChanged,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20629836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com