Qt Designer 无法引用 ApplicationWindow 大小

Qt Designer can't reference ApplicationWindow size

这是我第一次 post 在 Whosebug 中,所以我什至很难解释这个问题。

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

的父级

这在构建应用程序时工作正常,但在 Qt 设计器中页面大小为 0。 所以我无法在设计器中使用它们。

是否可以规避?

这是一个代码示例:

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