Question about CodeCompletionModel2 interface

Milian Wolff mail at milianw.de
Mon Nov 5 11:32:48 UTC 2012


On Sunday 04 November 2012 21:43:41 Christoph Cullmann wrote:
> 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?

What is the view being used for? When you execute a completion item, you don't 
need the view anymore, do you? Only the document matters, or not?

Cheers
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121105/6fe58f77/attachment.sig>


More information about the KDevelop-devel mailing list