How to search file name and making into the TXT file
-
I want to search specify file name and make the name to the bat file.
Now I can make a file name is auto.bat.
And make the first sentence AUTOLOAD.BAT
Following is my code.QFile file("auto.bat"); //建立或開啟auto.bat檔案 file.open(QIODevice::WriteOnly); //開啟檔案 const char *data = "AUTOLOAD.BAT"; //建立第一個字串AUTOLOAD.BAT file.write(data); file.close();Now I want to search specify file name (.B) and make sentence under the first.
QStringList QfilterB("*.B*"); //指定要篩選的字串 foreach(QFileInfo Bitm, mDir.entryInfoList(QfilterB)) { file.write(Bitm.fileName().toStdString); }It shown alarm like this. How could I fix it ??

-
"QString::toStdString" is a reference to a function, "QString::toStdString()" is a function call.
But you're looking for QString::toUtf8() -
"QString::toStdString" is a reference to a function, "QString::toStdString()" is a function call.
But you're looking for QString::toUtf8()@Christian-Ehrlicher said in How to search file name and making into the TXT file:
"QString::toStdString" is a reference to a function, "QString::toStdString()" is a function call.
But you're looking for QString::toUtf8()When I change to String() , it will shown

How could I fix it ??
-
@Christian-Ehrlicher said in How to search file name and making into the TXT file:
"QString::toStdString" is a reference to a function, "QString::toStdString()" is a function call.
But you're looking for QString::toUtf8()When I change to String() , it will shown

How could I fix it ??
