i want to send the textfield text from main.qml to search.qml file

main.qml snippet


Qt Code:
  1. TextField{
  2. id: search_text
  3. placeholderText: " Search "
  4. width: drawer.width
  5.  
  6.  
  7.  
  8. Image {
  9. id: search_button
  10. anchors.right: search_text.right
  11. anchors.verticalCenter: search_text.verticalCenter
  12. source: "qrc:/images/search.png"
  13. MouseArea{
  14. anchors.fill: search_button
  15. onClicked: {
  16. loader.source = "qrc:/pages/search.qml"
  17. stackView.push(loader.item)
  18. listView.currentIndex = -1
  19. }
  20.  
  21.  
  22.  
  23. }
  24. }
  25.  
  26. }
To copy to clipboard, switch view to plain text mode 


search.qml

Qt Code:
  1. import QtQuick 2.6
  2. import QtQuick.Controls 2.0
  3. import QtWebView 1.1
  4.  
  5. Pane {
  6. id: pane
  7.  
  8.  
  9. // recieve texinput here so that i can construct url
  10.  
  11. WebView{
  12. id:webview
  13. anchors.fill: parent
  14.  
  15. Component.onCompleted: url = "http://en.wikitolearn.org/"
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 


what i have tried ( i tried create a property in Search.qml and access this property through Loader.
For eg.

Qt Code:
  1. TextField{
  2. id: search_text
  3. placeholderText: " Search WikiToLearn"
  4. width: drawer.width
  5. onAccepted: {
  6. loader.item.search = search_text.text
  7. loader.source = "qrc:/pages/search.qml"
  8. stackView.push(loader.item)
  9. listView.currentIndex = -1
  10.  
  11.  
  12. }
To copy to clipboard, switch view to plain text mode 

but i got error :

qrc:/main.qml:104: TypeError: Type error
qrc:/main.qml:104: TypeError: Type error