[QScintilla] help!!!Code Completion in QScintilla

Phil Thompson phil at riverbankcomputing.com
Sat Jul 14 15:50:39 BST 2007


On Thursday 12 July 2007 9:05 pm, Joan Pablo Jimenez Milian wrote:
> Hi, thanks for your reply, as I said I am a little new with QScintilla (and
> Scintilla), I would like to get the full code completion of QScintilla but
> is just that I don't know how, I don't have a good documentation, and
> examples to do that. I really don't understand it. That's why I tried a
> simple way, but doesn't work. If you could help me please, I really need
> it.
>
> I get from my compiler all I need to put in the ListBox of the code
> completion, is just that I don't know how.

I still don't know what it is you are trying to do.

If you want "the full code completion of QScintilla" then you need to write a 
Scintilla lexer for your language. Then you need to write a QsciLexer 
subclass for it that manages the new lexer's styles settings. Scintilla 
lexers are usually written by modifying an existing one (one of the Lex*.cpp 
files).

Phil

> -----Original Message-----
> From: qscintilla-bounces at riverbankcomputing.com on behalf of Phil Thompson
> Sent: Thu 12/07/2007 10:07
> To: qscintilla at riverbankcomputing.com
> Subject: Re: [QScintilla] help!!!Code Completion in QScintilla
>
> On Thursday 12 July 2007 4:31 am, Joan Pablo Jimenez Milian wrote:
> > Hi, I work on ubuntu and I am developing  a simple IDE to edit
> > ActionScript projects, I am new in this world of QScintilla but I have
> > traying since some days ago how to implement the Code Completion with
> > QScintilla but have no results yet.  I don't know how to do it. So Please
> > if somebody can help me with a little piece of code, some example, I will
> > appreciate it very, very much. I'm going to put a little code that I have
> > tried but isn't work. Please help me.
> >
> >  my useless code
> >
> >  I have a class CTextEdit inherit from QsciScintilla with this method
> >
> > void CTextEdit::testTextModified(){
> >
> >              QString text = this->text();
> >              if(text[text.length()-1] == '.')
> >             {
> >                         QStringList list;    list << "aaaa";
> >                         list << "bbb";
> >                         list << "cc";
> >                         this->showUserList(1,list);
> >             }
> > }
> >
> > and in other place I connect the CTextEdit*textEdit = new CTextEdit in
> > this way
> >
> >  connect(textEdit, SIGNAL(textChanged()),  this,
> > SLOT(testTextModified()));
> >
> > The connection works and testTextModified() run. But nothing about the
> > completion. Please help me with some example.
>
> Are you trying to use the standard QScintilla auto-completion support, or
> are you trying to do something simpler with user lists?
>
> If you are trying to do full auto-completion (with support for language
> APIs) then Scintilla itself needs a lexer for your language. Otherwise you
> can just do auto-completion from the words in your document (see
> setAutoCompletionSource()).
>
> If you just want to do something simple with user lists then see the
> documentation for showUserList() and userListActivated().
>
> Phil
> _______________________________________________
> QScintilla mailing list
> QScintilla at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/qscintilla


More information about the QScintilla mailing list