Question about CodeCompletionModel2 interface

Christoph Cullmann cullmann at absint.com
Mon Nov 5 11:48:57 UTC 2012


E.g. the View has the TemplateInterface, therefore you need the view.
Besides: If you have everywhere else in the interface only the view, why only this function has only the document?

----- Ursprüngliche Mail -----
> 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
> _______________________________________________
> KWrite-Devel mailing list
> KWrite-Devel at kde.org
> https://mail.kde.org/mailman/listinfo/kwrite-devel
> 

-- 
-------------------------------------- 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