flyer_2001 |
2019-12-08 14:58 |
一种是楼上所述,别使用shadow build 另外也有可能是楼主编译器或编码,直接使用MINGW是正常的。 把目录下的databasefile删除掉,然后使用下述代码: - void MainWindow::readCarData()
{ if (!file->open(QIODevice::ReadOnly)) return;
QTextStream stream(file); QTextCodec *codec= QTextCodec::codecForName("GBK"); stream.setCodec(codec); QString xmlDataStr = stream.readAll(); file->close(); if (!carData.setContent(xmlDataStr)) { return; } }
|
|