List model for selection lists. 更多...
头: | #include <QVirtualKeyboardSelectionListModel> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS VirtualKeyboard)
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 ) |
This class acts as a bridge between the UI and the input method that provides the data for selection lists.
This enum specifies the dictionary type of a word.
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::DictionaryType::Default
|
0
|
The word candidate is from the default dictionary. |
QVirtualKeyboardSelectionListModel::DictionaryType::User
|
1
|
The word candidate is from the user dictionary. |
This enum specifies a role of the data requested.
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::Role::Display
|
Qt::DisplayRole
|
The data to be rendered in form of text. |
QVirtualKeyboardSelectionListModel::Role::DisplayRole
|
显示
|
obsolete
Use 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
Use Role::WordCompletionLength.
|
QVirtualKeyboardSelectionListModel::Role::Dictionary
|
258
|
An integer specifying l { QVirtualKeyboardSelectionListModel::DictionaryType }{dictionary type}. |
QVirtualKeyboardSelectionListModel::Role::CanRemoveSuggestion
|
259
|
A boolean value indicating if the word candidate can be removed from the dictionary. |
This enum specifies the type of selection list.
常量 | 值 | 描述 |
---|---|---|
QVirtualKeyboardSelectionListModel::Type::WordCandidateList
|
0
|
Shows list of word candidates. |
[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
)
This signal is emitted when an item at index is selected by the user.
[invokable]
void
QVirtualKeyboardSelectionListModel::
removeItem
(
int
index
)
This method should be called when the user removes an item at position 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 .