我根據網上的博文學習TabView,發現當Tab比較多的時候,每個Tab的title就顯示不全了,
而且擁擠在一起,如何Tab多的時候能出現箭頭,當單擊箭頭(類似Execl里的箭頭,如下圖2)后顯示下個tab
圖1

圖2

Code:
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
ApplicationWindow {
visible: true
width: 400
height: 300
maximumWidth:width
title: qsTr("Hello World")
TabView {
anchors.fill: parent
Tab {
title: "Red"
Rectangle { color: "red" }
}
Tab {
title: "Blue"
Rectangle { color: "blue" }
}
Tab {
title: "Green"
Rectangle { color: "green" }
}
Tab {
title: "Red"
Rectangle { color: "red" }
}
Tab {
title: "Blue"
Rectangle { color: "blue" }
}
Tab {
title: "Green"
Rectangle { color: "green" }
} Tab {
title: "Red"
Rectangle { color: "red" }
}
Tab {
title: "Blue"
Rectangle { color: "blue" }
}
Tab {
title: "Green"
Rectangle { color: "green" }
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/275987.html
標籤:Qt
上一篇:Educational Codeforces Round 107 (Rated for Div. 2) D. Min Cost String(構造)
下一篇:求救~~~如圖,為什么報紅
