Question about CodeCompletionModel2 interface
Christoph Cullmann
cullmann at absint.com
Sun Nov 4 20:43:41 UTC 2012
Hi,
the completion model 2 interface looks like:
/**
* You must inherit your completion-model from CodeCompletionModel2 if you want to
* use a hierarchical structure and want to receive execution-feedback.
* @see CodeCompletionModel::GroupRole
* */
class KTEXTEDITOR_EXPORT CodeCompletionModel2 : public CodeCompletionModel {
Q_OBJECT
public:
CodeCompletionModel2(QObject* parent);
/**
* 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.
*
* @param document the document to insert the completion into
* @param word the Range that the completions are based on (what the user entered
* so far)
* @param index identifies the completion match to insert
* */
virtual void executeCompletionItem2(Document* document, const Range& word, const QModelIndex& index) const;
};
Shouldn't the "Document *document" be a view? In snippet code hacks are done like "document->activeView()".
Could we change this for KDE 5 or are there reasons that it is that way?
Greetings
Christoph
--
-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH Email: cullmann at AbsInt.com
Science Park 1 Tel: +49-681-38360-22
66123 Saarbrücken Fax: +49-681-38360-20
GERMANY WWW: http://www.AbsInt.com
--------------------------------------------------------------------
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234
More information about the KDevelop-devel
mailing list