EnterKeyAction QML Type
提供用于自定义回车键的附加属性。更多
Import Statement: | import QtQuick.VirtualKeyboard |
附加属性
详细说明
EnterKeyAction 类型提供附加属性,允许自定义键盘上的回车键按钮。
EnterKeyAction 必须直接在接收输入焦点的项目中使用,例如TextInput 。
例如
TextInput { id: myInput EnterKeyAction.enabled: myInput.text.length > 0 || myInput.inputMethodComposing EnterKeyAction.label: "Next" Keys.onReleased: { if (event.key === Qt.Key_Return) { // execute action } } }
附加属性文档
EnterKeyAction.actionId : int |
设置虚拟键盘中回车键的动作 id。设置动作 id 后,它将优先于标签并为回车键设置图标。
EnterKeyAction.None
未定义动作。EnterKeyAction.Go
操作执行转到操作。例如,将用户带到输入的网址。EnterKeyAction.Search
执行搜索操作。EnterKeyAction.Send
发送输入的文本。EnterKeyAction.Next
将输入焦点移至下一个接受文本输入的字段。EnterKeyAction.Done
与 相同,只是所有文本输入都已完成。EnterKeyAction.Next
EnterKeyAction.enabled : bool |
启用或禁用虚拟键盘中的回车键按钮。
EnterKeyAction.label : string |
设置虚拟键盘中回车键的标签。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.