SelectionListModel QML Type

Provides a data model for the selection lists. 更多...

import 語句: import QtQuick.VirtualKeyboard 2.15
實例化: QVirtualKeyboardSelectionListModel

信號

方法

詳細描述

The SelectionListModel is a data model for word candidates provided by the input method.

An instance of a SelectionListModel cannot be created directly. Instead, the InputEngine manages the instances and provides access to the model by InputEngine::wordCandidateListModel 特性。

The model exposes the following data roles for the list delegate:

  • display Display text for item.
  • wordCompletionLength Word completion length for item.
  • dictionaryType Dictionary type of the word, see QVirtualKeyboardSelectionListModel::DictionaryType .
  • canRemoveSuggestion A boolean indicating if the word can be removed from the dictionary.

The activeItemChanged signal indicates which item is currently highlighted by the input method. The view should respond to this signal by highlighting the corresponding item in the list.

The user selection is handled by the selectItem() method. The view should be invoke this method when the user selects an item from the list.

信號文檔編製

void 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 在列錶中。

注意: 相應處理程序是 onActiveItemChanged .

void itemSelected ( int index )

此信號被發射當項位於 index 被用戶選中。

注意: 相應處理程序是 onItemSelected .

方法文檔編製

void removeItem ( int index )

應調用此方法當用戶移除項在位置 index from the list. The removal is forwarded to the input method for further processing.

void 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.