我试图用qt信号发出标准字符串.信号将被排队等待.我用qRegisterMetaType注册了类型,就像在qt文档中说的那样,但没有运气.我正在注册它
qRegisterMetaType<的std :: string>( “的std :: string”)
qRegisterMetaType<的std :: string>( “的std :: string”)
解决方法
你也应该做:
Q_DECLARE_MetaTYPE (std::string)
报价Qt Doc
Adding a Q_DECLARE_MetaTYPE() makes the type known to all template
based functions,including QVariant. Note that if you intend to use
the type in queued signal and slot connections or in QObject’s
property system,you also have to call qRegisterMetaType() since the names are resolved at runtime.