diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index c059e22d663..655608b36e2 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -1217,8 +1216,7 @@ void ModelManagerInterface::maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document doc->releaseSourceAndAST(); // delegate actual queuing to the gui thread - QMetaObject::invokeMethod(this, "queueCppQmlTypeUpdate", - Q_ARG(CPlusPlus::Document::Ptr, doc), Q_ARG(bool, scan)); + QTimer::singleShot(0, this, [this, doc, scan]() { queueCppQmlTypeUpdate(doc, scan); }); } void ModelManagerInterface::queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan) @@ -1315,7 +1313,7 @@ void ModelManagerInterface::updateCppQmlTypes(QFutureInterface &interface, qmlModelManager->m_cppDataHash = newData; if (hasNewInfo) // one could get away with re-linking the cpp types... - QMetaObject::invokeMethod(qmlModelManager, "asyncReset"); + QTimer::singleShot(0, qmlModelManager, &ModelManagerInterface::asyncReset); } ModelManagerInterface::CppDataHash ModelManagerInterface::cppData() const