QmlDesigner: Fix connection editor functions

Fix the connection editor not picking up all the slots of a model node
due to setting a wrong expression in the QmlJS::Document.

Change-Id: I2d28e1e779c5293991397ebc2a061c35234d9cae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2021-12-07 10:40:09 +01:00
committed by Henning Gründl
parent 5d75f1900b
commit 1996c4c8c8

View File

@@ -226,9 +226,12 @@ void ActionEditor::prepareConnections()
}
for (const auto &slotName : modelNode.metaInfo().slotNames()) {
if (slotName.startsWith("q_") || slotName.startsWith("_q_"))
continue;
QmlJS::Document::MutablePtr newDoc = QmlJS::Document::create(
QLatin1String("<expression>"), QmlJS::Dialect::JavaScript);
newDoc->setSource(QLatin1String(slotName));
newDoc->setSource(modelNode.id() + "." + QLatin1String(slotName));
newDoc->parseExpression();
QmlJS::AST::ExpressionNode *expression = newDoc->expression();