Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

elide of tab title in TabView

$
0
0
I am newbie… Just tried to modify the Qt example “Qt Quick Controls – gallery” for my needs. Its Styles.qml comes with the following code, and I just added one line to define the “elide” property of Text, which turned out has no effect. Any suggestions?     property Component tabViewStyle: TabViewStyle {         tabOverlap: 16         frameOverlap: 4         tabsMovable: true           frame: Rectangle {             gradient: Gradient{                 GradientStop { color: "#e5e5e5" ; position: 0 }                 GradientStop { color: "#e0e0e0" ; position: 1 }             }             border.color: "#898989"             Rectangle { anchors.fill: parent ; anchors.margins: 1 ; border.color: "white" ; color: "transparent" }         }         tab: Item {             property int totalOverlap: tabOverlap * (control.count - 1)             implicitWidth: Math.min ((styleData.availableWidth + totalOverlap)/control.count - 4, image.sourceSize.width)             implicitHeight: image.sourceSize.height             BorderImage {                 id: image                 anchors.fill: parent                 source: styleData.selected ? "../images/tab_selected.png" : "../images/tab.png"                 border.left: 30                 smooth: false                 border.right: 30             }             Text {                 text: styleData.title                 anchors.centerIn: parent                 elide: Text.ElideLeft  //---------------> my modification             }         }         leftCorner: Item { implicitWidth: 12 }     }

Viewing all articles
Browse latest Browse all 4972

Trending Articles