SelectionListModel QML Type
为选择列表提供数据模型。更多
Import Statement: | import QtQuick.VirtualKeyboard |
In C++: | QVirtualKeyboardSelectionListModel |
信号
- void activeItemChanged(int index)
- void itemSelected(int index)
方法
- void removeItem(int index)
- void selectItem(int index)
详细说明
SelectionListModel 是输入法提供的候选词数据模型。
SelectionListModel 的实例无法直接创建。相反,InputEngine 管理实例,并通过InputEngine::wordCandidateListModel 属性提供对模型的访问。
该模型为列表委托提供以下数据角色:
display
项目的显示文本。wordCompletionLength
项目的单词完成长度。dictionaryType
单词的字典类型,请参见 。QVirtualKeyboardSelectionListModel::DictionaryTypecanRemoveSuggestion
一个布尔值,表示该词是否可以从字典中删除。
activeItemChanged 信号表示输入法当前高亮了哪个项目。视图应响应该信号,高亮显示列表中的相应项目。
用户选择由selectItem() 方法处理。当用户从列表中选择一个项目时,视图应调用该方法。
信号文档
void activeItemChanged(int index) |
当列表中的活动项目发生变化时,将发出该信号。用户界面应通过高亮显示列表中index 的项目对该信号做出反应。
注: 相应的处理程序是onActiveItemChanged
。
void itemSelected(int index) |
当用户选择index 上的项目时,将发出此信号。
注: 相应的处理程序是onItemSelected
。
方法文档
void removeItem(int index) |
当用户从列表中删除index 位置的项目时,应调用此方法。该删除将转发给输入法作进一步处理。
void selectItem(int index) |
当用户从列表中选择index 位置的项目时,应调用此方法。选择结果将转发给输入法作进一步处理。
© 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.