![](/img/trans.png)
[英]QML - How to send/pass variable from one qml file to other qml file
[英]How use qml types in main qml file from other qml file
我在main.qml文件中有一個TextField
main.qml
ApplicationWindow {
id: mainWindow
header: ToolBar{
id: tbMain
TextField{
id: tfsearch
}
}
}
在main.qml文件中,我具有StackView
,我將searchresult.qml添加到此stackview中。
我想知道在searchresult.qml中如何使用main.qml中的TextField的textchanged信號和text屬性
在searchresult.qml
:
Connections {
target: tfsearch
onTextChanged: doStuff()
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.