Qt 如何知道qml中lib的版本
我在Qt5.9.3中工作,在没有x窗口的linux平台上编写qml程序 以下是我的代码:Qt 如何知道qml中lib的版本,qt,qml,Qt,Qml,我在Qt5.9.3中工作,在没有x窗口的linux平台上编写qml程序 以下是我的代码: import Qt3D.Core 2.13 Entity { id: sceneRoot ... Transform{ id: torusTransform scale3D: Qt.vector3d(1.5, 1, 0.5) rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
import Qt3D.Core 2.13
Entity {
id: sceneRoot
...
Transform{
id: torusTransform
scale3D: Qt.vector3d(1.5, 1, 0.5)
rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45)
...
}
但是,Qt creater中的转换中有一个下划线。
转换中的下划线表示发生了错误。我确信Qt53DCore库已添加到.pro文件中。
所以我的问题是:
我如何知道Qt3D.core的版本?
如何确保库中指定的qml类型?我不知道是否有简单的方法,但您可以查看旧的Qt文档,了解您需要的版本 您应该使用import Qt3D.Core 2.0。我在Qt5.9.3文件夹中搜索“Entity”关键字,在…/Qt5.9.3/qml/Qt3D/Core路径中,有一个名为plugins.qmltypes的文件 我打开它,发现了代码:
Component {
name: "Qt3DCore::Quick::Quick3DEntity"
defaultProperty: "data"
prototype: "Qt3DCore::QEntity"
exports: ["Qt3D.Core/Entity 2.0"]
exportMetaObjectRevisions: [0]
Property { name: "components"; type: "Qt3DCore::QComponent"; isList: true; isReadonly: true }
}
“导出:[“Qt3D.Core/Entity 2.0”]”告诉我版本和qml类型名称