KDE 4.9 PyKDE API Reference

- KDE's Python API

# CodeCompletionModel2 Class Reference

`from PyKDE4.ktexteditor import *`

Inherits: KTextEditor.CodeCompletionModel → QAbstractItemModel → QObject
Namespace: KTextEditor

## Detailed Description

You must inherit your completion-model from CodeCompletionModel2 if you want to use a hierarchical structure and want to receive execution-feedback.

See also:
  CodeCompletionModel.GroupRole

## Methods

| __init__ (self, QObject parent)
| executeCompletionItem2 (self, KTextEditor.Document document, KTextEditor.Range word, QModelIndex index)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent
| ) |  |  |

executeCompletionItem2 | ( | self, |
|  | KTextEditor.Document | document,
|  | KTextEditor.Range | word,
|  | QModelIndex | index
| ) |  |  |

This function is responsible for inserting a selected completion into the document. The default implementation replaces the text that the completions were based on with the Qt.DisplayRole of the Name column of the given match.

Parameters:

  | document | the document to insert the completion into
  | word | the Range that the completions are based on (what the user entered so far)
  | index | identifies the completion match to insert