Frame QML Type

逻辑控件组的可视化框架。更多

Import Statement: import QtQuick.Controls
Inherits:

Pane

Inherited By:

GroupBox

详细说明

Frame 用于将一组逻辑控件布局在一个可视化框架内。Frame 本身不提供布局,但需要您对其内容进行定位,例如通过创建RowLayoutColumnLayout

声明为框架子项的项目会自动成为框架contentItem 的父项。动态创建的项目需要显式地成为内容项目的父项。

如果在一个 Frame 中只使用一个项目,它的大小将调整为适合其所包含项目的隐式大小。因此,它特别适合与布局一起使用。

Frame {
    ColumnLayout {
        anchors.fill: parent
        CheckBox { text: qsTr("E-mail") }
        CheckBox { text: qsTr("Calendar") }
        CheckBox { text: qsTr("Contacts") }
    }
}

另请参阅 自定义框架容器控件

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.