ApplicationWindow {
visible: true
width: 480
height: 360
title: qsTr("TabView")
//flags: Qt.Window | Qt.FramelessWindowHint
objectName: "rootObject"
id : id_root
color: "white"
TabView {
id: frame
anchors.fill: parent
anchors.margins: 4
Tab {
title: "词汇表"
Text {
id: txt1
text: qsTr("hello, i am the first")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 30
}
}
Tab {
title: "已学会"
Text {
id: txt2
text: qsTr("hi, i am the second")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 30
}
}
style: TabViewStyle {
frameOverlap: 1
tab: Rectangle {
color: styleData.selected ? "steelblue" :"lightsteelblue"
//border.color: "steelblue"
border.width: 0
implicitWidth: 223
implicitHeight: 80
radius: 40
Text {
id: text
anchors.centerIn: parent
text: styleData.title
color: styleData.selected ? "white" : "black"
}
}
frame: Rectangle { color: "transparent" }
}
}
}