diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/emptyPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/emptyPane.qml index c797860c762..3ec325d8f14 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/emptyPane.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/emptyPane.qml @@ -13,11 +13,6 @@ Rectangle { height: 400 color: StudioTheme.Values.themePanelBackground - // Called from C++ to clear the search when the selected node changes - function clearSearch() { - // The function is empty, because it is a placeholder to match other panes - } - ColumnLayout { id: mainColumn anchors.fill: parent diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index aa81d3b6d11..86ee06fec7e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -453,7 +453,14 @@ void PropertyEditorView::resetView() if (m_qmlBackEndForCurrentType) { m_qmlBackEndForCurrentType->emitSelectionChanged(); - QMetaObject::invokeMethod(m_qmlBackEndForCurrentType->widget()->rootObject(), "clearSearch"); + + const auto qmlBackEndObject = m_qmlBackEndForCurrentType->widget()->rootObject(); + if (qmlBackEndObject) { + const auto metaObject = qmlBackEndObject->metaObject(); + const int methodIndex = metaObject->indexOfMethod("clearSearch()"); + if (methodIndex != -1) + metaObject->method(methodIndex).invoke(qmlBackEndObject); + } } m_locked = false;