qml文件:

import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
ApplicationWindow {
visible: true
id:idWindow
width: 1024.0; // this is the designer width size
height: 768.0; // this is the designer height size
title: qsTr("Hello World")
color: "#3A3223"

StackLayout{id: idstackview; anchors.fill: parent; currentIndex: tabBar.currentIndex;
One{id:test1}
Two{id:test2}
Third{id:test3}
Four{id:test4}
}

Rectangle{ id: idfoot
width: idWindow.width; height: 72; color: "#3A3223";anchors.bottom: parent.bottom
Rectangle{width: parent.width; height: 1;color: "#928D85";}

TabBar {
onCurrentIndexChanged: {
console.debug(tabBar.currentIndex)
}
id: tabBar; width: 700; height: 71;anchors.bottom: parent.bottom;
background: Rectangle{color: "#3A3223"}
currentIndex: 3
TabButton { width: height*1.2;height: 70;
onClicked: { idWindow.close();/*idWindow.showMinimized();*/ }}
TabButton { width: height*1.2;height: 70;}
TabButton { width: height*1.2;height: 70;}
TabButton { width: height*1.2;height: 70;}
TabButton { width: height*1.2;height: 70;}
}
}


}