Commit 23e63a76 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Avoid calling twice completer

parent e44a6981
...@@ -36,6 +36,7 @@ public: ...@@ -36,6 +36,7 @@ public:
, textEdit(editor) , textEdit(editor)
, q(qq) , q(qq)
{ {
createCompleter();
} }
TextEditorCompleterPrivate(QPlainTextEdit *editor, TextEditorCompleter *qq) TextEditorCompleterPrivate(QPlainTextEdit *editor, TextEditorCompleter *qq)
...@@ -44,6 +45,7 @@ public: ...@@ -44,6 +45,7 @@ public:
, textEdit(nullptr) , textEdit(nullptr)
, q(qq) , q(qq)
{ {
createCompleter();
} }
void setCompletion(const QString &completion); void setCompletion(const QString &completion);
...@@ -168,7 +170,6 @@ QCompleter *TextEditorCompleter::completer() const ...@@ -168,7 +170,6 @@ QCompleter *TextEditorCompleter::completer() const
void TextEditorCompleter::setCompleterStringList(const QStringList &listWord) void TextEditorCompleter::setCompleterStringList(const QStringList &listWord)
{ {
d->createCompleter();
d->completer->setModel(new QStringListModel(QStringList() << listWord << QStringLiteral("TESTING"), d->completer)); d->completer->setModel(new QStringListModel(QStringList() << listWord << QStringLiteral("TESTING"), d->completer));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment