mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
Fixed crash in completer of MimeTextEdit (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6483 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4ce08bee38
commit
e9db631f8f
1 changed files with 5 additions and 1 deletions
|
@ -33,6 +33,8 @@ MimeTextEdit::MimeTextEdit(QWidget *parent)
|
||||||
{
|
{
|
||||||
mCompleterKeyModifiers=Qt::ControlModifier;
|
mCompleterKeyModifiers=Qt::ControlModifier;
|
||||||
mCompleterKey=Qt::Key_Space;
|
mCompleterKey=Qt::Key_Space;
|
||||||
|
mForceCompleterShowNextKeyEvent=false;
|
||||||
|
mCompleterStartString="";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
|
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
|
||||||
|
@ -150,13 +152,15 @@ void MimeTextEdit::keyPressEvent(QKeyEvent *e)
|
||||||
if (!mCompleter || !isShortcut) // do not process the shortcut when we have a completer
|
if (!mCompleter || !isShortcut) // do not process the shortcut when we have a completer
|
||||||
QTextEdit::keyPressEvent(e);
|
QTextEdit::keyPressEvent(e);
|
||||||
|
|
||||||
|
if (!mCompleter) return; //Nothing else to do if not mCompleter initialized
|
||||||
|
|
||||||
if (!isShortcut && (mCompleter && !mCompleter->popup()->isVisible())) {
|
if (!isShortcut && (mCompleter && !mCompleter->popup()->isVisible())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mForceCompleterShowNextKeyEvent) {
|
if (!mForceCompleterShowNextKeyEvent) {
|
||||||
static QString eow(" ~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
|
static QString eow(" ~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
|
||||||
if (!isShortcut && ( e->text().isEmpty() || eow.contains(e->text().right(1)))){
|
if (!isShortcut && !e->text().isEmpty() && eow.contains(e->text())){
|
||||||
mCompleter->popup()->hide();
|
mCompleter->popup()->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue