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