- Since
- 3.1
IrcCompleter provides command and name completion for a text input field. The completer is made context aware by assigning a command parser and a buffer that is currently active in the GUI. The parser is used for completing commands, and the buffer is used for completing buffer and user names.
In order to perform a completion, call complete() with the current text input field content and the cursor position. If a suitable completion is found, the completed() signal is emitted with a suggestion for a new content and cursor position for the text input field.
TextField {
id: textField
Keys.onTabPressed: completer.complete(text, cursorPosition)
id: completer
buffer: ...
parser: ...
onCompleted: {
textField.text = text
textField.cursorPosition = cursor
}
}
}
- See also
- IrcCommandParser, IrcBuffer