C
KeyboardLayout QML Type
键盘布局。更多...
| Import Statement: | import QtQuick.VirtualKeyboard.Components |
| Since: | Qt Quick Ultralite 2.9 |
| Inherits: |
属性
- inputMethod : AbstractInputMethod
- inputMode : int
- keyWeight : real
- smallTextVisible : bool
详细说明
此类型是键盘布局的根元素。使用此元素来构建新的键盘布局。
示例:
import QtQuick import QtQuick.Layouts import QtQuick.VirtualKeyboard KeyboardLayout { KeyboardRow { Key { key: Qt.Key_Q text: "q" } Key { key: Qt.Key_W text: "w" } Key { key: Qt.Key_E text: "e" } Key { key: Qt.Key_R text: "r" } Key { key: Qt.Key_T text: "t" } Key { key: Qt.Key_Y text: "y" } } }
注意: 内置布局中 包含sharedLayouts 属性及createInputMethod() 函数,qmltocpp 工具会忽略这些内容。您无需在自定义布局中包含这些内容。
属性文档
inputMethod : AbstractInputMethod
设置此布局中要使用的输入法。
此属性允许在此布局中使用自定义输入法。
inputMode : int
设置此布局中要使用的输入模式。
默认情况下,虚拟键盘在切换到其他键盘布局时会尝试保留当前的输入模式。
如果当前输入模式在当前上下文中无效,则由输入法指定默认输入模式。
keyWeight : real
指定此键盘布局中所有键所使用的默认键权重。键权重是一个比例值,它会影响各个键之间相对大小的比例。
默认值为 0。
smallTextVisible : bool
为所有子键设置smallTextVisible 。
默认值为false 。
在某些 Qt 许可证下可用。
了解更多。