From ec63bc59be3f555deaf16d25a14b18bc07d64812 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Fri, 22 Dec 2017 16:50:33 +0100 Subject: [PATCH] Fix autocomplete not being refreshed properly upon first TAB --- src/widgets/helper/resizingtextedit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/widgets/helper/resizingtextedit.cpp b/src/widgets/helper/resizingtextedit.cpp index 3eaef4082..415eb74c6 100644 --- a/src/widgets/helper/resizingtextedit.cpp +++ b/src/widgets/helper/resizingtextedit.cpp @@ -92,6 +92,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event) if (!this->nextCompletion) { completionModel->refresh(); + this->completer->setModel(completionModel); // first selection this->completer->setCompletionPrefix(currentCompletionPrefix); this->nextCompletion = true; @@ -133,9 +134,6 @@ void ResizingTextEdit::setCompleter(QCompleter *c) this->completer->setWidget(this); this->completer->setCompletionMode(QCompleter::InlineCompletion); this->completer->setCaseSensitivity(Qt::CaseInsensitive); - /*QObject::connect(this->completer, SIGNAL(highlighted(QString)), this, - SLOT(insertCompletion(QString))); -*/ QObject::connect(completer, static_cast(&QCompleter::highlighted), this, &ResizingTextEdit::insertCompletion);