[QScintilla] Ctrl+Space and Autocomplete

Roberto Gerson rg.albuquerque at gmail.com
Thu Dec 16 00:55:03 GMT 2010


Hi Baz Walter,

thanks a lot for your answer.

I solved this problem.  This is my code:

/* Ctrl + Space == Autocomplete */
QShortcut shortcut_ctrl_space = new QShortcut(QKeySequence("Ctrl+Space"),
this);
connect(shortcut_ctrl_space, SIGNAL(activated()), this,
SLOT(autoCompleteFromAll()));

On Wed, Dec 15, 2010 at 10:15 PM, Baz Walter <bazwal at ftml.net> wrote:

> On 14/12/10 16:06, Roberto Gerson wrote:
>
>> Hi everyone,
>>
>> I'm new using QScintilla and I already have the most recent source code
>> compiled and working.
>>
>> Well, I'm creating  a Text Editor for NCL (http://www.ncl.org.br) and I
>> want
>> to use autocomplete features. I already can autocomplete some words when I
>> start to write them. Additionally, I would like to use Ctrl+Space to
>> enable
>> autocomplete. But I have no idea how to do this. Today, when I press Ctrl
>> +
>> Space, QScintilla add "NULL" to my text.
>>
>> Does Anyone know how to to this ?
>>
>
> QScintilla has no default key binding for ctrl+space, so it will output
> whatever text (if any) is associated with that key combination - which on
> your platform happens to be the control character NUL.
>
> to associate a different behaviour with that key combination, you could
> simply create a QShortcut for it and connect it to an appropriate signal
> handler.
>
> to invoke auto-completion, use one of QScintilla's autoCompleteFrom*
> methods.
>



-- 
sds/
Roberto Gerson de Albuquerque Azevedo (http://laws.deinf.ufma.br/~roberto)
----------
Mestre em Informática - Puc-Rio
Pesquisador - Laboratório Telemídia (http://www.telemidia.puc-rio.br)

Bacharel em Ciência da Computação - UFMA
Pesquisador - Laws - Laboratory of Advanced Web Systems - UFMA (
http://laws.deinf.ufma.br)
----------
Clube NCL: A liberdade de desenvolver e compartilhar conteúdo interativo!
Visite: http://clube.ncl.org.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20101215/fa674f79/attachment.html>


More information about the QScintilla mailing list