繁体   English   中英

Qt Designer无法引用ApplicationWindow大小

[英]Qt Designer can't reference ApplicationWindow size

这是我在stackoverflow上的第一篇文章,因此我什至很难解释问题。

我开始在Qt Designer和Creator中为我的应用开发UI。 考虑到可伸缩性,我将所有应用程序页面设计为以ApplicationWindow的宽度和高度为父

在构建应用程序时,这很好用,但是在Qt Designer中页面的大小为0。 因此,我无法在Designer中与他们合作。

有可能规避吗?

这是一个代码示例:

main.qml

ApplicationWindow {
        id: main_window
        visible: true
        width: 450
        height: 700
        minimumWidth: 450
        minimumHeight: 700

Page1.Form.ui.qml

Page {
    id: p_basicpage
    width: ApplicationWindow.width
    height: ApplicationWindow.height

构建应用程序后,就可伸缩性而言,它可以很好地正常运行。 问题出在设计师身上:

在此处输入图片说明

Page确实具有anchor.fill属性,可通过“ 文本编辑器” (而不是“ Form Editor )进行设置,并摆脱widthheight属性:

Page {
   id: p_basicpage
   anchors.fill: parent

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM