我在workspacemanager 类中有一个名为UpdateScreenshots 的公共信号,用于截取一些小部件的屏幕截图。然后它在我定义的结构中返回这些屏幕截图。这个调用是从一个线程进行的,因为截屏显然只能在主线程上完成。但是,此 invokemethod 调用不起作用,并且未调用 updatescreenshots 插槽。我可能做错了什么?有一个更好的方法吗?
调用方法调用
VmsWorkspaceManager::InfoStruct info;
QMetaObject::invokeMethod(m_Manager, "UpdateScreenshots", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(Vms::GuiWidgets::VmsWorkspaceManager::InfoStruct, info));
槽的定义;
public slots:
/**
* \brief Updates the current screenshots to be sent to a remote client
*/
InfoStruct UpdateScreenshots() const;