用于选定列表的列表模型。 更多...
头: | #include <QVirtualKeyboardSelectionListModel> |
CMake: |
find_package(Qt6 COMPONENTS VirtualKeyboard REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::VirtualKeyboard) |
qmake: | QT += virtualkeyboard |
实例化: | SelectionListModel |
继承: | QAbstractListModel |
enum class | DictionaryType { Default, User } |
enum class | Role { Display, DisplayRole, WordCompletionLength, WordCompletionLengthRole, Dictionary, CanRemoveSuggestion } |
enum class | Type { WordCandidateList } |
void | removeItem (int index ) |
void | selectItem (int index ) |
void | activeItemChanged (int index ) |
void | itemSelected (int index ) |
此类充当 UI 和 (为选定列表提供数据) 输入法之间的桥梁。
此枚举指定单词的字典类型。
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::DictionaryType::Default
|
0
|
单词候选来自默认字典。 |
QVirtualKeyboardSelectionListModel::DictionaryType::User
|
1
|
单词候选来自用户字典。 |
此枚举指定请求数据的角色。
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::Role::Display
|
Qt::DisplayRole
|
要以文本形式渲染的数据。 |
QVirtualKeyboardSelectionListModel::Role::DisplayRole
|
显示
|
obsolete
使用 Role::Display。
|
QVirtualKeyboardSelectionListModel::Role::WordCompletionLength
|
Qt::UserRole + 1
|
An integer specifying the length of the word the completion part expressed as the number of characters counted from the end of the string. |
QVirtualKeyboardSelectionListModel::Role::WordCompletionLengthRole
|
WordCompletionLength
|
obsolete
使用 Role::WordCompletionLength。
|
QVirtualKeyboardSelectionListModel::Role::Dictionary
|
258
|
整数指定 { QVirtualKeyboardSelectionListModel::DictionaryType }{dictionary type}. |
QVirtualKeyboardSelectionListModel::Role::CanRemoveSuggestion
|
259
|
A boolean value indicating if the word candidate can be removed from the dictionary. |
此枚举指定选定列表的类型。
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::Type::WordCandidateList
|
0
|
展示单词候选列表。 |
[signal]
void
QVirtualKeyboardSelectionListModel::
activeItemChanged
(
int
index
)
This signal is emitted when the active item in the list changes. The UI should react to this signal by highlighting the item at index 在列表中。
[signal]
void
QVirtualKeyboardSelectionListModel::
itemSelected
(
int
index
)
此信号被发射当项位于 index 被用户选中。
[invokable]
void
QVirtualKeyboardSelectionListModel::
removeItem
(
int
index
)
应调用此方法当用户移除项在位置 index from the list. The removal is forwarded to the input method for further processing.
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .
[invokable]
void
QVirtualKeyboardSelectionListModel::
selectItem
(
int
index
)
This method should be called when the user selects an item at position index from the list. The selection is forwarded to the input method for further processing.
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .