mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 22:52:54 -04:00
improved completion for chat (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6515 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a07e8d889a
commit
0b0010ff59
2 changed files with 20 additions and 4 deletions
|
@ -171,10 +171,15 @@ void MimeTextEdit::keyPressEvent(QKeyEvent *e)
|
|||
mCompleter->setCompletionPrefix(completionPrefix);
|
||||
mCompleter->popup()->setCurrentIndex(mCompleter->completionModel()->index(0, 0));
|
||||
}
|
||||
|
||||
QRect cr = cursorRect();
|
||||
cr.setWidth(mCompleter->popup()->sizeHintForColumn(0)
|
||||
+ mCompleter->popup()->verticalScrollBar()->sizeHint().width());
|
||||
mCompleter->complete(cr); // popup it up!
|
||||
|
||||
if (mCompleter->completionCount()==0 && isShortcut){
|
||||
QTextEdit::keyPressEvent(e);// Process the key if no match
|
||||
}
|
||||
mForceCompleterShowNextKeyEvent=false;
|
||||
}
|
||||
|
||||
|
@ -197,6 +202,10 @@ Qt::Key MimeTextEdit::getCompleterKey() const
|
|||
}
|
||||
void MimeTextEdit::forceCompleterShowNextKeyEvent(QString startString="")
|
||||
{
|
||||
if (!mCompleter) return; //Nothing else to do if not mCompleter initialized
|
||||
|
||||
if(!mCompleter->popup()->isVisible()){
|
||||
mForceCompleterShowNextKeyEvent=true;
|
||||
mCompleterStartString=startString;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue