Writing QString into file is weird
-
I try to write an QString into an file with this code:
// Write new. QFile f(QDir::homePath() + "/test/conf"); if (f.open(QIODevice::ReadWrite)) { QTextStream wr(&f); printf(window->qvaptDllPath.toStdString().c_str()); wr << "# do not edit\n" << endl << "[qvapt]\nqvapt_path = " << window->qvaptDllPath << endl << "qvapt_name = " << window->qvaptDllVersion << endl << endl << "[window]\nlast_window_state = " << window->theWindowState << endl; // TODO: more }
qvaptDllPath is
QString qvaptDllPath = "/home/jan/qvapt-0.1.1/qvapt_sdk.dll";
(currently pre-defined for testing), but all what I get is this in the file:qvapt_path = 0xcccc060
How can I fix this to write the "real" string?
~ jan