homeshareMTGUIMTFirstVersionsrcmtfirstversioncpp428 error no match for ‘operator’ operand types are ‘QDebug’ and ‘stdstring’ aka ‘std__cxx11basic_stringchar’ 428 qDebug__func____LINE__Co
The error message suggests that there is no overloaded operator<< for the types QDebug and std::string (or std::__cxx11::basic_string<char>).
In the code snippet provided, the line qDebug()<<__func__<<__LINE__<<CommonData::Instance()->m_vectDecodeTypeProfiles[0].token; is attempting to use the operator<< to output the values of __func__, __LINE__, and CommonData::Instance()->m_vectDecodeTypeProfiles[0].token to the QDebug object.
To fix this error, you can convert the std::string to a QString before using operator<< with QDebug. Here's an example:
qDebug() << __func__ << __LINE__ << QString::fromStdString(CommonData::Instance()->m_vectDecodeTypeProfiles[0].token);
This code snippet converts the std::string to a QString using the fromStdString() function before passing it to QDebug using operator<<
原文地址: https://www.cveoy.top/t/topic/icbX 著作权归作者所有。请勿转载和采集!