QtQuick.Controls2.0 Header、Footer:Tabbar

来源:互联网 发布:金山软件有哪些 编辑:程序博客网 时间:2024/05/16 17:20

写一段简单的代码,顶部导航和底部导航的curindex同步

import QtQuick 2.7import QtQuick.Controls 2.0import QtQuick.Layouts 1.0import QtQuick.Layouts 1.1import QtQuick.Window 2.0import QtQuick.Controls.Styles 1.4import QtQuick.Controls.Material 2.0import QtQuick.Controls.Universal 2.0ApplicationWindow {    id:root    visible: true;    height: 480;    width: 320;    header: TabBar {                id: headertabBar;                currentIndex:footertabBar.currentIndex                TabButton {                    text: qsTr("header Tab1");                }                TabButton {                    text: qsTr("header Tab2")                }                TabButton {                    text: qsTr("header Tab3")                }            }    footer: TabBar {        id: footertabBar        currentIndex: headertabBar.currentIndex        TabButton {            text: qsTr("footer Tab1");        }        TabButton {            text: qsTr("footer Tab2")        }        TabButton {            text: qsTr("footer Tab3")        }    }}

这里写图片描述

0 0
原创粉丝点击