Page QML Type

Styled page control with support for a header and footer. 更多...

import 語句: import QtQuick.Controls 2.2
Since: Qt 5.7
繼承: Control

特性

詳細描述

Page is a container control which makes it convenient to add a header and footer item to a page.

The following example snippet illustrates how to use a page-specific toolbar header and an application-wide tabbar footer.

import QtQuick.Controls 2.1
ApplicationWindow {
    visible: true
    StackView {
        anchors.fill: parent
        initialItem: Page {
            header: ToolBar {
                // ...
            }
        }
    }
    footer: TabBar {
        // ...
    }
}
					

另請參閱 ApplicationWindow and 容器控件 .

特性文檔編製

contentChildren : list < Item >

This property holds the list of content children.

The list contains all items that have been declared in QML as children of the page.

注意: 不像 contentData , contentChildren does not include non-visual QML objects.

另請參閱 Item::children and contentData .

[default] contentData : list < 對象 >

This property holds the list of content data.

The list contains all objects that have been declared in QML as children of the container.

注意: 不像 contentChildren , contentData does include non-visual QML objects.

另請參閱 Item::data and contentChildren .

contentHeight : real

This property holds the content height. It is used for calculating the total implicit height of the page.

This QML property was introduced in QtQuick.Controls 2.1 (Qt 5.8).

另請參閱 contentWidth .

contentWidth : real

This property holds the content width. It is used for calculating the total implicit width of the page.

This QML property was introduced in QtQuick.Controls 2.1 (Qt 5.8).

另請參閱 contentHeight .

This property holds the page footer item. The footer item is positioned to the bottom, and resized to the width of the page. The default value is null .

注意: Assigning a ToolBar , TabBar ,或 DialogButtonBox as a page footer automatically sets the respective ToolBar::position , TabBar::position ,或 DialogButtonBox::position 特性到 Footer .

另請參閱 header and ApplicationWindow::footer .

header : Item

This property holds the page header item. The header item is positioned to the top, and resized to the width of the page. The default value is null .

注意: Assigning a ToolBar , TabBar ,或 DialogButtonBox as a page header automatically sets the respective ToolBar::position , TabBar::position ,或 DialogButtonBox::position 特性到 .

另請參閱 footer and ApplicationWindow::header .

title : string

This property holds the page title.

The title is often displayed at the top of a page to give the user context about the page they are viewing.

ApplicationWindow {
    visible: true
    width: 400
    height: 400
    header: Label {
        text: view.currentItem.title
        horizontalAlignment: Text.AlignHCenter
    }
    SwipeView {
        id: view
        anchors.fill: parent
        Page {
            title: qsTr("Home")
        }
        Page {
            title: qsTr("Discover")
        }
        Page {
            title: qsTr("Activity")
        }
    }
}
												

版權所有  © 2014-2026 樂數軟件    

工業和信息化部: 粵ICP備14079481號-1