forked from qt-creator/qt-creator
Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed since they still rely on dynamic introspection (mainly QQuickItem cases). Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1250,8 +1250,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));
|
||||
QMetaObject::invokeMethod(this, [=] { queueCppQmlTypeUpdate(doc, scan); });
|
||||
}
|
||||
|
||||
void ModelManagerInterface::queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan)
|
||||
@@ -1392,7 +1391,7 @@ void ModelManagerInterface::updateCppQmlTypes(
|
||||
qmlModelManager->m_cppDeclarationFiles = newDeclarations;
|
||||
if (hasNewInfo)
|
||||
// one could get away with re-linking the cpp types...
|
||||
QMetaObject::invokeMethod(qmlModelManager, "asyncReset");
|
||||
QMetaObject::invokeMethod(qmlModelManager, &ModelManagerInterface::asyncReset);
|
||||
}
|
||||
|
||||
ModelManagerInterface::CppDataHash ModelManagerInterface::cppData() const
|
||||
|
||||
@@ -65,24 +65,20 @@ Utils::FileSystemWatcher *PluginDumper::pluginWatcher()
|
||||
void PluginDumper::loadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info)
|
||||
{
|
||||
// move to the owning thread
|
||||
metaObject()->invokeMethod(this, "onLoadBuiltinTypes",
|
||||
Q_ARG(QmlJS::ModelManagerInterface::ProjectInfo, info));
|
||||
metaObject()->invokeMethod(this, [=] { onLoadBuiltinTypes(info); });
|
||||
}
|
||||
|
||||
void PluginDumper::loadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri, const QString &importVersion)
|
||||
{
|
||||
// move to the owning thread
|
||||
metaObject()->invokeMethod(this, "onLoadPluginTypes",
|
||||
Q_ARG(QString, libraryPath),
|
||||
Q_ARG(QString, importPath),
|
||||
Q_ARG(QString, importUri),
|
||||
Q_ARG(QString, importVersion));
|
||||
metaObject()->invokeMethod(this, [=] { onLoadPluginTypes(libraryPath, importPath,
|
||||
importUri, importVersion); });
|
||||
}
|
||||
|
||||
void PluginDumper::scheduleRedumpPlugins()
|
||||
{
|
||||
// move to the owning thread
|
||||
metaObject()->invokeMethod(this, "dumpAllPlugins", Qt::QueuedConnection);
|
||||
metaObject()->invokeMethod(this, &PluginDumper::dumpAllPlugins, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void PluginDumper::onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info, bool force)
|
||||
|
||||
Reference in New Issue
Block a user