QtQuick.Controls2.0 Header、Footer:Tabbar

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

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQuick.Layouts 1.1
import QtQuick.Window 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Material 2.0
import QtQuick.Controls.Universal 2.0
ApplicationWindow { 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") }
    }
}

QtQuick.Controls2.0 Header、Footer:Tabbar_第1张图片

你可能感兴趣的:(Qt,Quick)