I am Using custom inputRow and MenuButton is placed Outside component when i try to print value of Val1 and Val2 it gives "ReferenceError: val1 is not defined", how can i access it Outside component.
InputRow {
name:"Command"
enabled: true
filename: "qrc:/AutonomyPlatform/Images/Parameters.svg"
component: Column {
spacing: 10
Row{
spacing: 50
Text {
text: "Val1"
color: Colors.menuBodyTextNormal
font.pointSize: 10
}
TextInput {
id:val1
width: 5
text: selectedModel ? "0" : ""
font.pointSize: 10
color: Colors.menuBodyTextInput
}
Text {
text: "m"
color: Colors.menuBodyTextNormal
font.pointSize: 10
}
}
Row {
spacing: 50
Text{
text: "Val2"
color: Colors.menuBodyTextNormal
font.pointSize: 10
}
TextInput {
id:val2
width: 5
text: selectedModel ? "0" : ""
font.pointSize: 10
color: Colors.menuBodyTextInput
}
Text {
text: "m"
color: Colors.menuBodyTextNormal
font.pointSize: 10
}
}
} //End of Column
MenuButton {
label: "Send"
buttonHeight: 25
buttonWidth: 35
onMenuButtonClicked:
{
console.log("VAL1",val1.text) //ReferenceError: val1 is not defined,
console.log("VAL2",val2.text)
console.log("SEND")
}
}
}
When i put Menubutton inside column component it prints as expected but when its outside component i get ReferenceError as mentioned above
Got a way to access this :