How Can I deserialize the output QVariant to std::string without using QT.
by reqs, My program could not include a Qt.
QVariant.toString().toStdString();
Example.
file.ini (write with QSetting)
..
ID="\x1\0\0\0\xd0\x8c\xd9\xec\xfb*"
profile_program /* Pseudo Code */
int main ()
{
void* IDQt =getIDFromIniFile("file.ini");
std::string myId = convertID(IDQt);
process(myID);
}
Look in the sources, probably src/corelib/kernel/qvariant.cpp for
QDataStream& operator<<(QDataStream&, const QVariant&). That way you’ll know what gets written during serialization.Once you do, you’ll see that the operator<< calls QVariant::save(QDataStream&). What’s written is as follows:
You need to drill down into QString and QMetaType to figure out how those are serialized.