QmlDesigner: Fix duplicate items auto completion

Fix duplicate items in the auto completion result by trimming the
strings. Otherwise items like "Item " and "Item" will both show up in
the result.

Task-number: QDS-2561
Change-Id: I0244fed19cf358d5c72ee169cd8ffa13672edce2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2020-07-16 13:05:03 +02:00
committed by Henning Gründl
parent 9d6f69abe9
commit bb79a7fb90

View File

@@ -355,7 +355,7 @@ QStringList qmlJSAutoComplete(QTextDocument *textDocument,
} }
for (int i = 0; i < model->size(); ++i) for (int i = 0; i < model->size(); ++i)
list.append(proposal->model()->text(i)); list.append(proposal->model()->text(i).trimmed());
list.append(prefix); list.append(prefix);
} }