Hello everyone. I'm writing my own qml object for textinput. What I'have done so far is:

Qt Code:
  1. //Input.qml file
  2. import QtQuick 2.8
  3. import QtGraphicalEffects 1.0
  4. Item {
  5. id:root
  6.  
  7. property color shadowColor:"#b7b7b7"
  8. property color backgroundColor:"#eaeaea"
  9. property int shadowRadius:4
  10. property alias text:yazı.text
  11. property bool shadowless:false
  12. property alias radius:arkaplan.radius
  13. property bool icon : simge.source
  14.  
  15. Rectangle{
  16. id:arkaplan
  17. anchors.fill: parent
  18. radius:2
  19. color:backgroundColor
  20. border.color: backgroundColor
  21. layer.enabled: true
  22. layer.effect: DropShadow{
  23. radius: if(!shadowless) radius=shadowRadius; else radius=0;
  24. samples: 9
  25. transparentBorder: true
  26. color: shadowColor
  27. verticalOffset: 0
  28. horizontalOffset: 0
  29. }
  30. }
  31.  
  32. TextInput{
  33. anchors.fill: parent
  34. id:text
  35. verticalAlignment: Qt.AlignVCenter
  36. padding: 8
  37. font.bold: true
  38. onFocusChanged: console.log("focus changed to: "+focus)
  39.  
  40. }
  41.  
  42. }
To copy to clipboard, switch view to plain text mode 

but, when I once focus the TextInput, no matter what I do (clicking outside the element, hitting esc key) I can't lose the focus. If I put two TextInput, then I can lose one's focus by clicking the other.
I have just found a weird way to lose the focus:
Qt Code:
  1. import QtQuick 2.8
  2. import QtQuick.Window 2.2
  3. import "qrc:/UI"
  4. Window {
  5. visible: true
  6. width: 640
  7. height: 480
  8. title: qsTr("Hello World")
  9. FocusScope{
  10. id:fakeFocus
  11. }
  12.  
  13. MouseArea{
  14. anchors.fill: parent
  15. onPressed: fakeFocus.forceActiveFocus()
  16.  
  17. }
  18. Input{
  19. width:128
  20. height: 32
  21. x:64
  22. y:23
  23. radius: 0
  24. }
  25. Input{
  26. width:128
  27. height: 32
  28. x:64
  29. y:64
  30. radius: 0
  31. }
  32.  
  33. }
To copy to clipboard, switch view to plain text mode 

this way, I can lose the focus by clicking outside. But it seemed so dirty way of doing this. Is there any other method?
Thanks,