import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
TextField {
id:textField
width: 130
height: 50
}
Button {
anchors.right: parent.right
text: "lose Focus"
}
}
Run Code Online (Sandbox Code Playgroud)
为什么在单击按钮时 textField 不会失去焦点?如何实现点击TextField外的区域使TextField失去焦点?