Common parent for all key types. 更多...
import 语句: | import QtQuick.VirtualKeyboard 2.15 |
继承: | |
继承者: |
BackspaceKey , ChangeLanguageKey , EnterKey , FillerKey , HideKeyboardKey , Key ,和 ShiftKey |
BaseKey is a common type for all keys in keyboard layout.
This type should not be used directly in the layouts. The specialized key types, such as Key or EnterKey 应该被使用以取而代之。
active : bool |
This property holds the active status of the key.
This property is automatically set to true when the key is pressed.
alternativeKeys : var |
Sets the list of alternative keys.
This property can be set to a string, or a list of strings. If the value is a string, the alternative keys are presented as individual characters of that string. If the value is a list of strings, the list is used instead.
The alternative keys are presented to the user by pressing and holding a key with this property set.
注意:
If the alternative keys contains the key
text
, it will be filtered from the
effectiveAlternativeKeys
and its position will be used as an indicator for the highlighted item instead.
The default is empty list.
displayText : string |
Sets the display text.
This string is rendered in the keyboard layout.
The default value is the key text.
[read-only] effectiveAlternativeKeys : var |
This property contains the effective alternative keys presented to user.
The list is contains the items in the
alternativeKeys
excluding the
text
项。
该特性在 QtQuick.VirtualKeyboard 2.0 引入。
[read-only] effectiveAlternativeKeysHighlightIndex : int |
This property contains the index of highlighted item in the
effectiveAlternativeKeys
.
The index is calculated from the index of the key
text
在
alternativeKeys
.
For example, if the alternative keys contains "çcċčć" and the key
text
is "c", this index will become 1 and the effective alternative keys presented to user will be "ç[ċ]čć".
该特性在 QtQuick.VirtualKeyboard 2.0 引入。
functionKey : bool |
Sets the function key attribute.
默认为 false。
highlighted : bool |
Sets the highlighted status of the key.
默认为 false。
key : int |
Sets the key code for input method processing.
The default is Qt.Key_unknown.
Sets the key panel delegate for the key.
This property is essential for key decoration. Without a key panel delegate, the key is invisible. This property should be assigned in the inherited key type.
noKeyEvent : bool |
This property controls whether the key emits key events for input method processing. When true, the key events are disabled.
By default, the key event is emitted if the key is not unknown or the text is not empty.
This property was introduced in QtQuick.VirtualKeyboard 1.3.
noModifier : bool |
Disables key modifiers on the emitted key.
默认为 false。
This property was introduced in QtQuick.VirtualKeyboard 1.3.
pressed : bool |
This property holds the pressed status of the key.
The pressed status can only be true if the key is both enabled and active. When the key state becomes pressed, it triggers a key down event for the input engine. A key up event is triggered when the key is released.
repeat : bool |
Sets the key repeat attribute.
If the repeat is enabled, the key will repeat the input events while held down. The repeat should not be used if alternativeKeys is also set.
默认为 false。
showPreview : bool |
Sets the show preview attribute.
By default, the character preview popup is not shown for function keys.
smallText : string |
Sets the small text rendered in the corner of the key.
The default value based on the default item in the effective alternative keys.
该特性在 QtQuick.VirtualKeyboard 2.0 引入。
smallTextVisible : bool |
Sets the visibility of small text.
The default value is inherited from the parent.
该特性在 QtQuick.VirtualKeyboard 2.0 引入。
[read-only] soundEffect : url |
This property holds the sound effect to be played on key press.
This property is read-only since the sound effects are defined in the keyboard style.
This property was introduced in QtQuick.VirtualKeyboard 1.1.
text : string |
Sets the key text for input method processing.
In most cases, this is the Unicode representation of the key code.
默认值为空字符串。
uppercased : bool |
This property holds the uppercase status of the key.
By default, this property reflects the uppercase status of the keyboard.
weight : real |
Sets the key weight value which determines the relative size of the key.
Use this property to change the key size in the layout.
The default value is inherited from the parent element of the key in the layout hierarchy.
This signal is triggered when the key is pressed, allowing custom processing of key.
注意:
相应处理程序是
onClicked
.