[QScintilla] help!!!Code Completion in QScintilla

Phil Thompson phil at riverbankcomputing.com
Thu Jul 12 15:07:32 BST 2007


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


More information about the QScintilla mailing list