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

Accessing TabView component

$
0
0
Dear people, I have a qml application which has a TabView. Obviously I have created components to assign them to Tabs. There is a component that consists of 2 textfields. Outside of tabview I have a button. onClick of thay button I need to call a c++ function and pass texts of those 2 textfields. Using textfields’ ids don’t work, because they are created dynamically. How do I access, for example, textfield’s text, which is inside a component assigned to a tabview? Optionally, here is brief version of my code:     TabView {         x: 8         y: 8           id:tab           Component.onCompleted: {               addTab("Type", typeComoponent);             addTab("Unit", unitTab)           }         } One of components:     Component {           id:typeComoponent           GroupBox{               id: groupbox1             width: 63.2                 TextField {                   id: typefield               }                 TextField {                   id: baseField               }           }       } I want to access those from here:     Button {           id: saveBtn                 onClicked: {               adddial.typeSaveClicked(...); //Have to pass tests of tesfields to this function           }

Viewing all articles
Browse latest Browse all 4972

Trending Articles