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

Tab View How to Get Currently Selected Tab and Make an Element visible

$
0
0
I need to set visibility of some element according to tab selected, that is in my main view there are many tabs and some tabes with common element, I need to make this visible when corresponding tab clicked, is it possible? Below is my qml,  TabView {                         id:v_serch_tab                         anchors.top:title.bottom                         height:50                         width: parent.width                         style: touchStyle                               Tab {                             title: "Face"                         }                                                 Tab {                             title: "Motion"                             Component.onCompleted: input_fild_main_alert.visible = false;                         }                         Tab {                             title: "Access"                             Component.onCompleted: input_fild_main_alert.visible = false;                         }                                                 Component {                             id: touchStyle                             TabViewStyle {                                 //tabsAlignment: Qt.AlignVCenter                                   tabOverlap: 0                                 frame: Item { }                                 tab: Item {                                     implicitWidth: control.width/control.count                                     implicitHeight: 50                                       BorderImage {                                         id:current_tab                                         anchors.fill: parent                                         border.bottom: 8                                         border.top: 8                                         source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png"                                               Text {                                             anchors.centerIn: parent                                             color: styleData.selected ?"#1E90FF":"white"                                               text: styleData.title.toUpperCase()                                             font.pixelSize:styleData.selected ? 18:16                                             font.bold:styleData.selected ? true:false                                         }                                         Rectangle {                                             visible: index > 0                                             anchors.top: parent.top                                             anchors.bottom: parent.bottom                                             anchors.margins: 10                                             width:1                                             color: "#1E90FF"                                           }                                         }                                 }                             }                         }                                             }   //need to visible or invisible this element according to tab slelected Rectangle{ visible: false .................. }

Viewing all articles
Browse latest Browse all 4972

Trending Articles