i find QsciScintilla a super libs but code AutoCompletion not run ok... it display a not clickable widged.... ( only keyboard can secect!)
i have implement the QT4 QCompleter combobox and its run Super..
only its display on not correct place ....
my problem how i can find the cursor QRect on QsciScintilla?
i bring QsciScintilla getWord(int position) to public and i can bring word to QCompleter class...
/* completer from qt4 make it */
void QViScintilla::CursorAtIndex(int line ,int cool )
{
/* start from connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(CursorAtIndex(int,int))); */
setAutoCompletionFillupsEnabled(false); /* ensure not start scite autoxx */
int newPos = SendScintilla(SCI_GETCURRENTPOS);
CURRENTWORD = getWord(newPos); /* bring getWord(int position) to public !!!!! */
qDebug() << "### word " << CURRENTWORD; /* word piece on cursor */
}
/* now i display it so ... its not correct cursor position ..... display qt4 QCompleter */
cr.setWidth(c->popup()->sizeHintForColumn(0) + c->popup()->verticalScrollBar()->sizeHint().width());
c->complete(cr); // popup it up!
/* completer from qt4 make it */
void QViScintilla::CursorAtIndex(int line ,int cool )
{
/* start from connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(CursorAtIndex(int,int))); */
setAutoCompletionFillupsEnabled(false); /* ensure not start scite autoxx */
int newPos = SendScintilla(SCI_GETCURRENTPOS);
CURRENTWORD = getWord(newPos); /* bring getWord(int position) to public !!!!! */
qDebug() << "### word " << CURRENTWORD; /* word piece on cursor */
}
/* now i display it so ... its not correct cursor position ..... display qt4 QCompleter */
QPoint pointers(QCursor::pos());
QRect cr = QRect ( posX, posY ,20,20);
cr.setWidth(c->popup()->sizeHintForColumn(0) + c->popup()->verticalScrollBar()->sizeHint().width());
c->complete(cr); // popup it up!
To copy to clipboard, switch view to plain text mode
Bookmarks