21,475
社区成员
发帖
与我相关
我的任务
分享

具体Screen怎么用呢,可以去官网文档找Qt5.12->QML->Screen
文档一般说的够清楚的,需要import对应的包,然后你就可以使用了。
QML经常会出现这种无法自动填充的问题,自己手打Screen.width就行了,just do it。
然后你就可以看到想要的大小了。
此例图截取自Qt5.13版本QML文档,要求import 2.13代码中我import的是2.3,一样可以用。Component {
name: "QQuickScreenAttached"
prototype: "QQuickScreenInfo"
Property { name: "orientationUpdateMask"; type: "Qt::ScreenOrientations" }
Property { name: "height"; type: "int"; isReadonly: true }
Property { name: "width"; type: "int"; isReadonly: true }
Method {
name: "angleBetween"
type: "int"
Parameter { name: "a"; type: "int" }
Parameter { name: "b"; type: "int" }
}
}