Utils: Allow setting HistoryCompleter size

While the HistoryCompleter did have private functions to
change the History List length, these were not used or
accessible. This change adds an argument to allow the
caller to change the maximum size of the list.

Its used by the Lua REPL pane.

Change-Id: I6baf260db5da9d8fe58a37ff0af3ec59396a5be0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-08-06 09:10:34 +02:00
parent 6471572135
commit 9d6c78155f
5 changed files with 12 additions and 21 deletions

View File

@@ -195,7 +195,7 @@ public:
// clang-format on
inputEdit->setReadOnly(true);
inputEdit->setHistoryCompleter(Utils::Key("LuaREPL.InputHistory"));
inputEdit->setHistoryCompleter(Utils::Key("LuaREPL.InputHistory"), false, 200);
connect(inputEdit, &QLineEdit::returnPressed, this, [this, inputEdit] {
inputEdit->setReadOnly(true);