From 08e4191e5a750b96498d5c25c377fe228c413c97 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Mon, 3 Nov 2025 11:11:55 +0100 Subject: [PATCH] Gui: Force Expression Completer to show drop-down upon clicking on item (#25011) As the title says - currently if user clicks "Box" from the autocomplete dropdown, it adds "Box.", but the property drop-down is never resolved further, so user has to delete the separator and write it by hand. When a completion ends with '.' or '#' and is being selected by clicking, code sets `block=true` and calls `slotTextChanged()` which prevents the `textChanged2` signal from being emitted. This results in completer being blocked from updating next level of properties. So, this patch adds a direct call to `completer->slotUpdate()`, which triggers completer to parse the expression and show the drop-down. --- src/Gui/ExpressionCompleter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index ac872251ea..698e2005a6 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -1158,6 +1158,12 @@ void ExpressionTextEdit::slotCompleteText(const QString& completionPrefix) Base::FlagToggler flag(block, false); cursor.insertText(completionPrefix); completer->updatePrefixEnd(cursor.positionInBlock()); + + std::string textToComplete = completionPrefix.toUtf8().constData(); + if (textToComplete.size() + && (*textToComplete.crbegin() == '.' || *textToComplete.crbegin() == '#')) { + completer->slotUpdate(cursor.block().text(), cursor.positionInBlock()); + } } void ExpressionTextEdit::keyPressEvent(QKeyEvent* e)