1
私はQt 5.6ラボコントロールを使用しています。私はTabBarとSwipeViewを使用します。しかし、TabButtonsはクリックしません。 Itemコントロールの背景をペイントしたいので、Rectangleを使用しますが、四角形がすべての画面を塗りつぶします。私のアプリと私はこれが欲しい:IMAGE。 これは私のコードです:Qt.labs.controls:TabButtonsはクリックしません
import QtQuick 2.6
import Qt.labs.controls 1.0
Rectangle {
TabBar {
id: tabbar
width: parent.width
currentIndex: view.currentIndex
TabButton {
text: qsTr("1")
}
TabButton {
text: qsTr("2")
}
TabButton {
text: qsTr("3")
}
}
SwipeView {
id: view
anchors.fill: parent
currentIndex: tabbar.currentIndex
Item {
id: tab0
Rectangle {
color: "red"
}
}
Item {
id: tab1
Rectangle {
anchors.fill: parent // -> This command is fill all screen so I don't click TabButtons.
color: "blue"
}
}
Item {
id: tab2
Rectangle {
anchors.fill: parent
color: "lightblue"
}
}
}
}
ありがとう。
おかげで、これは本当の答えです。 –